It wasnarrated from Ibn 'Umar that the Messenger of Allah (ﷺ)said:
"The Muslim is obliged to obey (the ruler) whether he likes itornot, unless he is commanded to commit an act of disobedience. If heis commanded to commit a sin then he should neither listen nor obey."
English reference: Vol. 4, Book 24, Hadith 2864
Arabic reference: Book 24, Hadith 2974
Read hadith from the major collections in the app, with prayer times and a Qibla compass. Free.