كتاب الجهاد والسير
32  
The Book of Jihad and Expeditions
(22)
Chapter: Permissibility of fighting those who break a treaty; Permissibility of letting besieged people surrender, subject to the judgement of a just person who is qualified to pass judgement
(22)
باب جَوَازِ قِتَالِ مَنْ نَقَضَ الْعَهْدَ وَجَوَازِ إِنْزَالِ أَهْلِ الْحِصْنِ عَلَى حُكْمِ حَاكِمٍ عَدْلٍ أَهْلٍ لِلْحُكْمِ
Sahih Muslim 1768 b

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.
وَحَدَّثَنَا زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا عَبْدُ الرَّحْمَنِ بْنُ مَهْدِيٍّ، عَنْ شُعْبَةَ، بِهَذَا الإِسْنَادِ وَقَالَ فِي حَدِيثِهِ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ لَقَدْ حَكَمْتَ فِيهِمْ بِحُكْمِ اللَّهِ ‏"‏ ‏.‏ وَقَالَ مَرَّةً ‏"‏ لَقَدْ حَكَمْتَ بِحُكْمِ الْمَلِكِ ‏"‏ ‏.‏
Reference : Sahih Muslim 1768b
In-book reference : Book 32, Hadith 78
USC-MSA web (English) reference : Book 19, Hadith 4369
  (deprecated numbering scheme)