The Prophet ﷺ said, "After me, your affairs will be governed by men who will extinguish the Sunnah, act according to innovation, and delay the prayer beyond its appointed times."I asked, "Messenger of Allah, if I live to see them, what should I do?"He replied, "Are you asking me, son of Umm Abd, what you should do? There is no obedience to anyone who disobeys Allah."
أن النبي ﷺ قال: سيلي أموركم بعدي رجال يطفئون السنة، ويعملون بالبدعة، ويؤخرون الصلاة عن مواقيتها فقلت: يا رسول الله إن أدركتهم كيف أفعل؟ قال: تسألني يا ابن أم عبد كيف تفعل؟ لا طاعة لمن عصى الله.
Reported by Ibn Majah (2865), Ahmad (3790), and Bayhaqi (3/124) through various routes from Abdullah bin Uthman bin Khuthaym, from Qasim bin Abdul-Rahman bin Abdullah bin Masud, from his father, from his grandfather Abdullah bin Masud, who related it. Its isnad is hasan because of Abdullah bin Uthman bin Khuthaym, for he is hasan al-hadith. As for Abdul-Rahman bin Abdullah bin Masud, he did hear from his father, as stated by Bukhari, Abu Hatim, and others, though some denied that he heard from him, including Shuba and Ibn Main and others. This is also an abridgment of what Nasai (779) and Ibn Majah (1255) both reported through the route of Abu Bakr bin Ayyash, from Asim, from Zirr, from Abdullah bin Masud, who said, the Messenger of Allah ﷺ said, "You will perhaps come upon a people who pray the prayer outside its proper time. If you come upon them, then pray in your homes at the time you know, then pray with them, and treat it as a voluntary prayer." Ibn Khuzayma (1640) graded this sahih from this route.As for the statement, "There is no obedience to one who disobeys Allah," it means in matters that oppose the command of Allah, that is, one should perform the prayer at its proper time in his home, then pray with them so as not to also be disobedient toward them, since the time for prayer is broad.Malik reported in the chapter on the pledge of allegiance (3) from Abdullah bin Dinar that Abdullah bin Umar wrote to Abdul-Malik bin Marwan pledging allegiance to him, writing to him, "In the name of Allah, the Most Gracious, the Most Merciful. To proceed, from the servant of Allah, Abdullah, to Abdul-Malik, Commander of the Faithful, peace be upon you. I praise to you Allah, other than whom there is no god, and I confirm to you my hearing and obedience according to the way of Allah and the way of His Messenger, as far as I am able."Bukhari reported it in the Book of Rulings (7203, 7205) through the route of Yahya (that is, Qattan), from Sufyan (that is, Ibn Uyayna), from Abdullah bin Dinar, in similar wording.Among the beliefs of the people of the sunnah is that when the people unite behind one who has seized power, obedience to him becomes obligatory, as Ibn Umar did. He had refused to pledge allegiance to Ibn Zubayr or to Abdul-Malik, but when Abdul-Malik prevailed and matters became settled for him, Ibn Umar pledged allegiance to him.Harmala said, I heard Shafii say, "Whoever prevails over the caliphate by the sword until he is called caliph and the people unite behind him is indeed the caliph." Bayhaqi reported this in Manaqib Shafii (1/448).Imam Ahmad said, "The foundations of the sunnah according to us..." then he mentioned several matters and said, "and hearing and obeying the leaders and the Commander of the Faithful, whether righteous or wicked, and whoever assumes the caliphate and the people unite behind him and accept him, or whoever overpowers them by the sword until he becomes caliph and is called Commander of the Faithful." He also said, "Whoever rises up against the leader of the Muslims after the people had united behind him and acknowledged his caliphate, whether by consent or by conquest, has split the unity of the Muslims and contradicted the reports from the Messenger of Allah ﷺ. If the one who rose up against him dies, he dies the death of the pre-Islamic ignorance. It is not lawful to fight the ruler or to rise up against him for anyone, and whoever does so is an innovator departing from the sunnah and the right path." See Sharh Itiqad by Lalikai (1/160-161).He also said, "Submission to the one whom Allah has placed in authority over your affairs, do not withdraw your hand from obedience to him, and do not rise against him with your sword until Allah grants you relief and a way out. Do not rise up against the ruler, but listen and obey, and do not break your pledge of allegiance, for whoever does so is an innovator, opposed to and separated from the community. And if the ruler commands you with something that is disobedience to Allah, then you must not obey him at all in that matter, but neither may you rise up against him, nor withhold from him his due right." See Tabaqat Hanabila by Ibn Abu Yaala (1/24-25).Ibn Hajar said, "The jurists have agreed on the obligation of obeying the ruler who has seized power, and on waging jihad alongside him, and that obeying him is better than rising up against him, because of the preservation of life and the calming of turmoil that this brings." Fath al-Bari (7/13).Shaykh al-Islam Muhammad bin Abdul-Wahhab, may Allah have mercy on him, said, "The scholars of every school are agreed that whoever overpowers a town or towns has the ruling status of the leader in all matters." Durar Sunniyyah fil-Ajwibah Najdiyyah (7/239).Barbahari (d. 328 AH) said, "If you see a man cursing the ruler, know that he is a man of desire. And if you hear a man praying for the ruler's righteousness, know that he is a man of the sunnah, Allah willing. Fudayl bin Iyad used to say, 'If I had one prayer, I would spend it only on the ruler.' We have been commanded to pray for their righteousness, and we have not been commanded to curse them, even if they are unjust and oppressive, because their injustice and oppression fall upon themselves and upon the Muslims, while their righteousness benefits themselves and the Muslims." See Tabaqat Hanabila by Ibn Abu Yaala (2/36).In these accounts, which are extremely numerous, lies the principle that among the beliefs of the people of the sunnah and the community is that rising up against the leaders, even if they are unjust, is forbidden, unless one sees from them open and unmistakable disbelief.