It is narrated from Sa'b bin Jaththamah Al-Laithi (may Allah be pleased with him) that the Prophet (ﷺ) was asked about the ruling concerning the families of the polytheists when a night raid is carried out against them, and small children and women are also affected by it. The Messenger of Allah (ﷺ) said: "They are from among them." Sometimes Sufyan (may Allah have mercy on him) narrated the words in the hadith as: "They are from among their fathers."
Hadith Referenceمسند الإمام الشافعي / كتاب الجهاد وقسم الغنائم / 1737