The people of Qurayzah agreed to surrender on the judgment of Saad bin Muaz, so the Messenger of Allah ﷺ sent for Saad. He came riding on a donkey, and when he drew near the mosque, the Messenger of Allah ﷺ said to the Ansar, "Stand up for your chief," or he said, "for the best among you."Then he said, "These people have surrendered on your judgment."Saad said, "Their fighters are to be killed and their offspring taken captive."The Prophet ﷺ said, "You have judged with the judgment of Allah." And sometimes he said, "You have judged with the judgment of the King."
نزل أهل قريظة على حكم سعد بن معاذ، فأرسل رسول الله ﷺ إلى سعد، فأتاه على حمار، فلما دنا قريبا من المسجد قال رسول الله ﷺ للأنصار: قوموا إلى سيدكم- أو- خيركم ثم قال: إن هؤلاء نزلوا على حكمك قال: تقتل مقاتلتهم، وتسبي ذريتهم. قال: فقال النبي ﷺ: قضيت بحكم الله وربما قال: قضيت بحكم الملك.
Bukhari narrated it in the Merits of the Ansar (3804), and Muslim in Jihad (1768-64), both through Shuba, from Saad bin Ibrahim, from Abu Umama bin Sahl bin Hunayf, from Abu Saeed Khudri, who related it. This is the wording of Muslim, and the wording of Bukhari is similar.