Language:
كتاب الجهاد والسير
56  
Fighting for the Cause of Allah (Jihaad)
(168)
Chapter: If the enemy is ready to accept the judgement of a Muslim
(168)
باب إِذَا نَزَلَ الْعَدُوُّ عَلَى حُكْمِ رَجُلٍ
Sahih al-Bukhari 3043

Narrated Abu Sa`id Al-Khudri:

When the tribe of Bani Quraiza was ready to accept Sa`d's judgment, Allah's Messenger (ﷺ) sent for Sa`d who was near to him. Sa`d came, riding a donkey and when he came near, Allah's Messenger (ﷺ) said (to the Ansar), "Stand up for your leader." Then Sa`d came and sat beside Allah's Messenger (ﷺ) who said to him. "These people are ready to accept your judgment." Sa`d said, "I give the judgment that their warriors should be killed and their children and women should be taken as prisoners." The Prophet (ﷺ) then remarked, "O Sa`d! You have judged amongst them with (or similar to) the judgment of the King Allah."

حَدَّثَنَا سُلَيْمَانُ بْنُ حَرْبٍ، حَدَّثَنَا شُعْبَةُ، عَنْ سَعْدِ بْنِ إِبْرَاهِيمَ، عَنْ أَبِي أُمَامَةَ ـ هُوَ ابْنُ سَهْلِ بْنِ حُنَيْفٍ ـ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ ـ رضى الله عنه ـ قَالَ لَمَّا نَزَلَتْ بَنُو قُرَيْظَةَ عَلَى حُكْمِ سَعْدٍ ـ هُوَ ابْنُ مُعَاذٍ ـ بَعَثَ رَسُولُ اللَّهِ صلى الله عليه وسلم، وَكَانَ قَرِيبًا مِنْهُ، فَجَاءَ عَلَى حِمَارٍ، فَلَمَّا دَنَا قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ قُومُوا إِلَى سَيِّدِكُمْ ‏"‏‏.‏ فَجَاءَ فَجَلَسَ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالَ لَهُ ‏"‏ إِنَّ هَؤُلاَءِ نَزَلُوا عَلَى حُكْمِكَ ‏"‏‏.‏ قَالَ فَإِنِّي أَحْكُمُ أَنْ تُقْتَلَ الْمُقَاتِلَةُ، وَأَنْ تُسْبَى الذُّرِّيَّةُ‏.‏ قَالَ ‏"‏ لَقَدْ حَكَمْتَ فِيهِمْ بِحُكْمِ الْمَلِكِ ‏"‏‏.‏
Reference : Sahih al-Bukhari 3043
In-book reference : Book 56, Hadith 249
USC-MSA web (English) reference : Vol. 4, Book 52, Hadith 280
  (deprecated numbering scheme)