Mishkat al-Masabih #3558
The Offices of Commander and Qadi
The Arabic includes the chain of narration (sanad) and the collector's commentary; the English translation shows the Prophet's words only.
وَعَنْ مُعَاوِيَةَ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «يَا مُعَاوِيَةُ إِنْ وُلِّيتَ أَمْرًا فَاتَّقِ اللَّهَ وَاعْدِلْ» . قَالَ: فَمَا زِلْتُ أَظُنُّ أَنِّي مُبْتَلًى بِعَمَلٍ لِقَوْلِ النَّبِيِّ صَلَّى الله عَلَيْهِ وَسلم حَتَّى ابْتليت
Mu'awiya reported God’s Messenger as saying, “If you are put in a position of authority, Mu'awiya, fear God and act justly.” He said that he kept thinking he would be afflicted by a governorship in accordance with what the Prophet had said till it actually came true.
Ahmad. Baihaqi transmitted Mu‘awiya’s tradition in Dalail an-nubuwa.
Topics
About Mishkat al-Masabih
This hadith is #3558 from Mishkat al-Masabih, in the Book of The Offices of Commander and Qadi.