Imam al-Shafi'i (may Allah have mercy on him) said: The Prophet (peace and blessings be upon him) took the women and children of Banu Qurayzah captive and sold them to the polytheists. Abu al-Shahm the Jew bought an old woman and her child from the Prophet (peace and blessings be upon him), and (the Prophet (peace and blessings be upon him)) divided the remaining captives into three parts: he sent one third to Tihamah, one third to Najd and one third towards Syria, and they were sold in exchange for horses, weapons, camels and wealth.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18328