A woman was found killed in one of the battles of the Prophet ﷺ, and the Messenger of Allah ﷺ condemned the killing of women and children.In another wording, the Messenger of Allah ﷺ forbade the killing of women and children.
أن امرأة وجدت في بعض مغازي النبي ﷺ مقتولة، فأنكر رسول الله ﷺ قتل النساء والصبيان. وفي لفظ: فنهى رسول الله ﷺ عن قتل النساء والصبيان.
Bukhari narrated it in the Book of Jihad and Expeditions (3041), and Muslim narrated it in the Book of Jihad (1744:24), both of them through Layth (that is, Ibn Saad), from Nafi, that Abdullah bin Umar informed him, and he mentioned it. The other wording is found in Bukhari (3015), and Muslim (1744:25), through Ubaydullah, from Nafi, from Ibn Umar, with it.