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

It has been narrated on the authority of Abu Sa'id al-Khudri who said:

The people of Quraiza surrendered accepting the decision of Sa'd b. Mu'adh about them. Accordingly, the Messenger of Allah (ﷺ) sent for Sa'd who came to him riding a donkey. When he approached the mosque, the Messenger of Allah (ﷺ) said to the Ansar: Stand up to receive your chieftain. Then he said (to Sa'd): These people have surrendered accepting your decision. He (Sa'd) said: You will kill their fighters and capture their women and children. (Hearing this), the Prophet (ﷺ) said: You have adjudged by the command of God. The narrator is reported to have said: Perhaps he said: You have adjudged by the decision of a king. Ibn Muthanna (in his version of the tradition) has not mentioned the alternative words.
وَحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَمُحَمَّدُ بْنُ الْمُثَنَّى، وَابْنُ، بَشَّارٍ - وَأَلْفَاظُهُمْ مُتَقَارِبَةٌ - قَالَ أَبُو بَكْرٍ حَدَّثَنَا غُنْدَرٌ، عَنْ شُعْبَةَ، وَقَالَ الآخَرَانِ، حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، حَدَّثَنَا شُعْبَةُ، - عَنْ سَعْدِ بْنِ إِبْرَاهِيمَ، قَالَ سَمِعْتُ أَبَا أُمَامَةَ بْنَ سَهْلِ بْنِ حُنَيْفٍ، قَالَ سَمِعْتُ أَبَا سَعِيدٍ، الْخُدْرِيَّ قَالَ نَزَلَ أَهْلُ قُرَيْظَةَ عَلَى حُكْمِ سَعْدِ بْنِ مُعَاذٍ فَأَرْسَلَ رَسُولُ اللَّهِ صلى الله عليه وسلم إِلَى سَعْدٍ فَأَتَاهُ عَلَى حِمَارٍ فَلَمَّا دَنَا قَرِيبًا مِنَ الْمَسْجِدِ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم لِلأَنْصَارِ ‏"‏ قُومُوا إِلَى سَيِّدِكُمْ - أَوْ خَيْرِكُمْ ‏"‏ ‏.‏ ثُمَّ قَالَ ‏"‏ إِنَّ هَؤُلاَءِ نَزَلُوا عَلَى حُكْمِكَ ‏"‏ ‏.‏ قَالَ تَقْتُلُ مُقَاتِلَتَهُمْ وَتَسْبِي ذُرِّيَّتَهُمْ ‏.‏ قَالَ فَقَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ قَضَيْتَ بِحُكْمِ اللَّهِ - وَرُبَّمَا قَالَ - قَضَيْتَ بِحُكْمِ الْمَلِكِ ‏"‏ ‏.‏ وَلَمْ يَذْكُرِ ابْنُ الْمُثَنَّى وَرُبَّمَا قَالَ ‏"‏ قَضَيْتَ بِحُكْمِ الْمَلِكِ ‏"‏ ‏.‏
Reference : Sahih Muslim 1768a
In-book reference : Book 32, Hadith 77
USC-MSA web (English) reference : Book 19, Hadith 4368
  (deprecated numbering scheme)