Then he—may Allah have mercy on him—cited the ḥadīth of al-Saʿb b. Jaththāmah: The Prophet ﷺ was asked about the inhabitants of a dwelling among the polytheists who are attacked by night and some of their women and children are struck. He replied, “They are part of them.” (1)
He added: This does not conflict with the Prophet’s ban on killing women and children, for here they are struck unintentionally, whereas that ban concerns deliberate killing. Moreover, those children are not like the children and offspring of the Muslims, nor like the treaty-bound subjects, for the latter enjoy guaranteed inviolability and security by virtue of their covenants and pledges.
As for the women and children of those at war with us, they possess no such guaranteed protection, yet it is still unlawful to kill them deliberately so long as they themselves are not combatants.
If they are killed during a siege or a night-time raid, the Muslims are not required to desist