Yes. There is consensus that it is forbidden to slay non-combatant women and children during war. Additionally, the view of the majority is that it is also forbidden to slay very old men.
This has been cited in the exegesis of the following verse; as women, children and old men are from those who do not participate in fighting and killing them is transgression:
وقاتلوا في سبيل الله الذين يقاتلونكم ولا تعتدوا إن الله لا يحب المعتدين
Fight in the way of Allah those who fight you but do not transgress. Indeed. Allah does not like transgressors.
— Quran 2:190
It is evidenced in ahadith:
فنهى رسول الله صلى الله عليه وسلم عن قتل النساء والصبيان
Allah's Messenger (ﷺ) forbade the killing of women and children.
— Bukhari and Muslim
لا تقتلوا شيخا فانيا ولا طفلا ولا صغيرا ولا امرأة
Do not kill a decrepit old man, nor an infant, nor a young child, nor a woman
— Sunan Abi Dawud
Similar Instructions from the caliphs Abu Bakr and Umar to the armies they dispatched may be found in e.g. Sunan al-Kubra al-Bayhaqi and Musannaf Ibn Abi Shaiba.
Note that the prohibition is in regard to killing, the Imam had the option to enslave or ransom prisoners of war.