During some of the Ghazawat of Messenger of Allah ﷺ a woman was found killed, so Messenger of Allah ﷺ forbade the killing of women and children.
قُلْتُ لأَبِي أُسَامَةَ حَدَّثَكُمْ عُبَيْدُ اللَّهِ عَنْ نَافِعٍ عَنِ ابْنِ عُمَرَ ؓ قَالَ وُجِدَتِ امْرَأَةٌ مَقْتُولَةً فِي بَعْضِ مَغَازِي رَسُولِ اللَّهِ ﷺ فَنَهَى رَسُولُ اللَّهِ ﷺ عَنْ قَتْلِ النِّسَاءِ وَالصِّبْيَانِ