Sahih Muslim #4597 · The Book of Jihad and Expeditions

Sahih MuslimThrough the same chain of transmitters Shu'ba has narrated the same tradition in which he says that the Messenger of Allah
Sahih Muslim · Book 32 · The Book of Jihad and Expeditions
Sahih Muslim · كتاب 32 · كتاب الجهاد والسير
You have adjudged according to the command of God. And once he said: you have adjudged by the decision of a king.
وَحَدَّثَنَا زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا عَبْدُ الرَّحْمَنِ بْنُ مَهْدِيٍّ، عَنْ شُعْبَةَ، بِهَذَا الإِسْنَادِ وَقَالَ فِي حَدِيثِهِ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏
"‏ لَقَدْ حَكَمْتَ فِيهِمْ بِحُكْمِ اللَّهِ ‏"‏ ‏.‏ وَقَالَ مَرَّةً ‏"‏ لَقَدْ حَكَمْتَ بِحُكْمِ الْمَلِكِ ‏"‏ ‏.‏
Reference : Sahih Muslim 4597In-book reference : Book 32, Hadith 78