Abu Hurairah (May Allah be pleased with him) reported:
The Messenger of Allah (ﷺ) said, "It is obligatory upon you to listen and obey the orders of the ruler in prosperity and adversity, whether you are willing or unwilling, or when someone is given undue preference to you."[Muslim].
Arabic/English book reference: Book 1, Hadith 667
Read hadith from the major collections in the app, with prayer times and a Qibla compass. Free.