كتاب الإمارة
33
The Book on Government
(9)
Chapter: The ruler is a shield from behind whom they fight and by whom they are protected
(9)
باب فِي الإِمَامِ إِذَا أَمَرَ بِتَقْوَى اللَّهِ وَعَدَلَ كَانَ لَهُ أَجْرٌ ‏‏

It has been narrated on the authority of Abu Huraira that the Prophet of Allah (ﷺ) said:

A commander (of the Muslims) is a shield for them. They fight behind him and they are protected by (him from tyrants and aggressors). If he enjoins fear of God, the Exalted and Glorious, and dispenses justice, there will be a (great) reward for him; and if he enjoins otherwise, it redounds on him.
حَدَّثَنَا إِبْرَاهِيمُ، عَنْ مُسْلِمٍ، حَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا شَبَابَةُ، حَدَّثَنِي وَرْقَاءُ، عَنْ أَبِي الزِّنَادِ، عَنِ الأَعْرَجِ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ إِنَّمَا الإِمَامُ جُنَّةٌ يُقَاتَلُ مِنْ وَرَائِهِ وَيُتَّقَى بِهِ فَإِنْ أَمَرَ بِتَقْوَى اللَّهِ عَزَّ وَجَلَّ وَعَدَلَ كَانَ لَهُ بِذَلِكَ أَجْرٌ وَإِنْ يَأْمُرْ بِغَيْرِهِ كَانَ عَلَيْهِ مِنْهُ ‏"‏ ‏.‏
Reference : Sahih Muslim 1841
In-book reference : Book 33, Hadith 70
USC-MSA web (English) reference : Book 20, Hadith 4542
  (deprecated numbering scheme)