Abu Saeed Khudri reported,

The people of Qurayzah surrendered to the judgment of Saad bin Muaz, so the Messenger of Allah ﷺ sent for Saad, who came to him on a donkey. When he drew near the mosque, the Messenger of Allah ﷺ said to the Ansar, "Stand up for your leader," or "your best one."Then he said, "These people have surrendered to your judgment."Saad said, "Their fighters shall be killed and their offspring taken captive."The Prophet ﷺ said, "You have judged according to the ruling of Allah," and sometimes he said, "You have judged according to the ruling of the King."Ibn al-Muthanna did not mention the phrase "and sometimes he said, 'You have judged according to the ruling of the King.'"

Muslim 4596

Sahih

و حدثنا أبو بكر بن أبي شيبة ومحمد بن المثنى وابن بشار وألفاظهم متقاربة قال أبو بكر حدثنا غندر عن شعبة و قال الآخران حدثنا محمد بن جعفر حدثنا شعبة عن سعد بن إبراهيم قال سمعت أبا أمامة بن سهل بن حنيف قال سمعت

أبا سعيد الخدري قال

نزل أهل قريظة على حكم سعد بن معاذ فأرسل رسول الله ﷺ إلى سعد فأتاه على حمار فلما دنا قريبا من المسجد قال رسول الله ﷺ للأنصار قوموا إلى سيدكم أو خيركم ثم قال إن هؤلاء نزلوا على حكمك قال تقتل مقاتلتهم وتسبي ذريتهم قال فقال النبي ﷺ قضيت بحكم الله وربما قال قضيت بحكم الملك ولم يذكر ابن المثنى وربما قال قضيت بحكم الملك

مسلم 4596صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Jihad and expeditions
Chapter
Permissibility of fighting those who broke the covenant and permissibility of allowing the people of a fortress to surrender to the judgment of a just ruler qualified to judge
Numbering
Darussalam 4596
Muslim 4596