Sahih Muslim 1768 b
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
وَحَدَّثَنَا زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا عَبْدُ الرَّحْمَنِ بْنُ مَهْدِيٍّ، عَنْ شُعْبَةَ، بِهَذَا الإِسْنَادِ وَقَالَ فِي حَدِيثِهِ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم لَقَدْ حَكَمْتَ فِيهِمْ بِحُكْمِ اللَّهِ " . وَقَالَ مَرَّةً " لَقَدْ حَكَمْتَ بِحُكْمِ الْمَلِكِ " ."
Through the same chain of transmitters Shu'ba has narrated the same tradition in which he says that the Messenger of Allah (ﷺ) said (to Sa'd):
You have adjudged according to the command of God. And once he said: you have adjudged by the decision of a king.
Full reference and source
Sahih Muslim 1768 b In-book : Book 32, Hadith 78 USC-MSA web (English) : Book 19, Hadith 4369 (deprecated)
View source on Sunnah.com (opens in a new tab)