كتاب الجهاد والسير
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 1769 b

It has been narrated on the authority of Hisham (who learnt it from his father) that the Messenger of Allah (ﷺ) said (to Sa'd):

You have adjudged their case with the judgment of God. the Exalted and Glorified.
وَحَدَّثَنَا أَبُو كُرَيْبٍ، حَدَّثَنَا ابْنُ نُمَيْرٍ، حَدَّثَنَا هِشَامٌ، قَالَ قَالَ أَبِي فَأُخْبِرْتُ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ لَقَدْ حَكَمْتَ فِيهِمْ بِحُكْمِ اللَّهِ عَزَّ وَجَلَّ ‏"‏ ‏.‏
Reference : Sahih Muslim 1769b
In-book reference : Book 32, Hadith 80
USC-MSA web (English) reference : Book 19, Hadith 4371
  (deprecated numbering scheme)