The Messenger of Allah ﷺ said, "Set out in the name of Allah, by Allah, and upon the religion of the Messenger of Allah. Do not kill a feeble old man, an infant, a young child, or a woman. Do not act treacherously with the spoils. Gather your spoils together, set things right, and do good, for Allah loves those who do good."
أن رسول الله ﷺ قال: انطلقوا باسم الله، وبالله، وعلى ملة رسول الله، ولا تقتلوا شيخا فانيا، ولا طفلا، ولا صغيرا، ولا امرأة، ولا تغلوا، وضموا غنائمكم، وأصلحوا، وأحسنوا، إن الله يحب المحسنين.
Abu Dawud (2614) reported it, and Bayhaqi (9/90) reported it through his route, from Uthman bin Abu Shayba, who said, Yahya bin Adam and Ubaydullah bin Musa narrated to us, from Hasan bin Salih, from Khalid bin Fazr, who said, Anas bin Malik narrated to me, and he mentioned it.Its chain is hasan because of Khalid Fazr (with kasra on the fa and sukun on the za, followed by a plain ra), who is from Basra. No one narrated from him except Hasan bin Salih bin Huyayy. Yahya said, "He is not much." Abu Hatim said, "A shaykh." Ibn Hibban mentioned him among the trustworthy narrators. The conclusion regarding him is that his hadith is graded hasan so long as he does not bring something that is rejected of him.