Narrated Junada bin Abi Umaiyya: We entered upon Ubadah bin As-Samit while he was sick. We said, “May Allah make you good and healthy. Will you tell us a Hadith you heard from the Prophet, peace be upon him, and by which Allah may make you benefit?” He said, “The Prophet, peace be upon him, called us and we gave him the Ba’it — pledge of Islam. And among the conditions on which we gave him the Ba’it — pledge from us was that we were to listen and obey (the orders of a Muslim ruler) both at the time when we were active and at the time when we were tired. [We were to listen and obey] at our difficult time, and at our ease. And [we were] to be obedient to the ruler even if he did not give us our right, and not to fight against him unless we noticed him having open disbelief for which we would have a proof with us from Allah.”
(9: 179- O.B. Sahih Al-Bukhari)
Narrated Ibn Omar: The Prophet, peace be upon him, said, “It is obligatory for one to listen to and obey (a Muslim ruler’s orders) unless these orders involve one in disobedience (to Allah). And if an act of disobedience (to Allah) is imposed, one should not listen to or obey it.”
[4: 203- O.B. Sahih Al-Bukhari]
Narrated Abu Hurairah: I heard Allah’s Messenger, peace be upon him, saying, “We are the last but will be the foremost (to enter Paradise).” The Prophet, peace be upon him, added, “He who obeys me, obeys Allah, and he who disobeys me, disobeys Allah. He, who obeys Muslim chief, obeys me, and he who disobeys the Muslim chief, disobeys me. The Imam is like a shelter for whose safety the Muslims should fight and where they should seek protection. If the Imam orders people to be dutiful to Allah and fear Him and rules justly, then he will be rewarded for that, and if he does the opposite, he will be responsible for that.”
[4: 204- O.B. Sahih Al-Bukhari)