عَنْ أَبِي هُرَيْرَةَ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «مَنْ أَطَاعَنِي فَقَدْ أَطَاعَ اللَّهَ وَمَنْ عَصَانِي فَقَدْ عَصَى اللَّهَ وَمَنْ يُطِعِ الْأَمِيرَ فَقَدْ أَطَاعَنِي وَمَنْ يَعْصِ الْأَمِيرَ فَقَدْ عَصَانِي وَإِنَّمَا الْإِمَامُ جُنَّةٌ يُقَاتَلُ مِنْ وَرَائِهِ وَيُتَّقَى بِهِ فَإِنْ أَمَرَ بِتَقْوَى اللَّهِ وَعَدَلَ فَإِنَّ لَهُ بِذَلِكَ أَجْرًا وَإِنْ قالَ بغَيرِه فَإِن عَلَيْهِ مِنْهُ»
Translation

Abu Huraira reported God's Messenger as saying, “He who obeys me has obeyed God and he who disobeys me has disobeyed God; he who obeys the commander has obeyed me and he who disobeys the commander has disobeyed me. The imam is only a shield behind whom fighting is engaged in and by whom protection is sought; so if he commands piety and acts justly he will have a reward for that, but if he holds another view he will on that account be held guilty.” (Bukhari and Muslim.)

Comment

The Offices of Commander and Qadi

A commentary from Mishkat al-Masabih on Hadith 3661

The Chain of Obedience

The Prophet establishes a sacred hierarchy: obedience to him constitutes obedience to Allah, and obedience to the legitimate commander constitutes obedience to him. This establishes the religious obligation of obeying rightful authority.

This chain preserves religious and political order, preventing chaos and ensuring the implementation of divine law through proper channels of authority.

The Imam as Shield

The metaphor of the imam as a shield indicates his protective function for the community. He serves as a barrier against external threats and internal discord, much as a shield protects the warrior in battle.

This protection extends to both physical security and religious integrity, as the imam is responsible for maintaining the conditions wherein Muslims can properly practice their faith.

Conditions and Limitations

Obedience to the commander is conditional upon his adherence to piety and justice. If he commands righteousness, obedience is obligatory and brings reward.

However, if the commander orders disobedience to Allah, obedience is not required. The hadith indicates such a ruler will bear the sin of his misguidance while followers are not obliged to comply with unlawful commands.

Scholarly Interpretation

Classical scholars like Ibn Hajar and An-Nawawi explain that this hadith establishes the obligation of obeying Muslim rulers in matters not involving sin, while maintaining the principle that there is no obedience to creatures in disobedience to the Creator.

The "shield" metaphor emphasizes that even an imperfect ruler is preferable to the chaos that would result from rejecting authority altogether, provided he maintains basic Islamic framework.