The Messenger of Allah (ﷺ) used not to kill the children, so thou shouldst not kill them unless you could know what Khadir had known about the child he killed, or you could distinguish between a child who would grow up to he a believer (and a child who would grow up to be a non-believer), so that you killed the (prospective) non-believer and left the (prospective) believer aside.
Sahih Muslim Book 32, Hadith 167
← Previous Hadith
If I had not the fear of committing (sin) for concealing the knowledge I would not have written to him. Najda wrote to him saying (after praising the Almighty and invoking blessings on the Prophet): Tell me whether the Messenger of Allah (ﷺ) took women to participate with him in Jihad; (if he did), whether he allotted them a regular share from the booty; whether he killed the children of (the enemy in the war), how long an orphan would be entitled to consideration as such, and for whom the Khums (fifth part of the booty) was booty. Ibn Abbas wrote to him: You have written asking me whether the Messenger of Allah (ﷺ) took women with him to participate in Jihad. He did take them to the battle and sometimes he fought along with them. They would treat the wounded and were given a reward from the booty, but he did not assign any regular share for them. And the Messenger of Allah (ﷺ) did not kill the children of the enemy, so you should not kill the children. Also you have written to me asking me when the orphanhood of an orphan comes to an end. By my life, if a man has become bearded but is still incapable of getting his due from others or fulfilling his obligation towards them, (he is yet an orphan to be treated as such), but when he can look after his interests like grown-up people, he is no longer an orphan. And you have written to me inquiring about Khums as to whom it is meant for. (In this connection) we (the kinsmen of the Messenger of Allah) used to say: It is for us, but those people (i.e. Banu Umayya) have denied it to us.
Sahih Muslim Book 32, Hadith 166 Next Hadith → Najda b. 'Amir al-Haruri wrote to Ibn Abbas asking him about the slave and the woman as to whether they would get a share from the booty (it they participated in Jihad) ; about the killing of (enemy) children (in war) ; about the orphan as to when his orphanhood comes to an end; about kinsmen (of the Holy Prophet) as to who they are. He said to Yazid: Write to him. (If he were not likely to fall into folly, I would not have written to him.) Write: You have written asking about the woman and the slave whether they would get a share of the booty if they participated in Jihad. (You should know that) there is nothing of the sort for them except that they will be given a prize. And you have written asking me about the killing of the enemy children in war. (You should understand that) the Messenger of Allah (may peare be upon him) did not kill them. and thou shouldst not kill them unless thou knew what the companion of Moses (i. e. Khadir) knew about the boy he had killed. And you have written asking me about the orphan as to when the period of his orphanhood comes to an end, so that the sobriquet of" orphan" is dropped from him. (In this regard, you should know that) the sobriquet" orphan" will not be dropped from him until he attains maturity of body and mind. And you have written asking me about the close relatives (of the Holy Prophet) as to who they are. We think that it is we, but our people have denied us this (position and its concomitant privileges).
Sahih Muslim Book 32, Hadith 168
Sahih Muslim Book 32, Hadith 166 Next Hadith → Najda b. 'Amir al-Haruri wrote to Ibn Abbas asking him about the slave and the woman as to whether they would get a share from the booty (it they participated in Jihad) ; about the killing of (enemy) children (in war) ; about the orphan as to when his orphanhood comes to an end; about kinsmen (of the Holy Prophet) as to who they are. He said to Yazid: Write to him. (If he were not likely to fall into folly, I would not have written to him.) Write: You have written asking about the woman and the slave whether they would get a share of the booty if they participated in Jihad. (You should know that) there is nothing of the sort for them except that they will be given a prize. And you have written asking me about the killing of the enemy children in war. (You should understand that) the Messenger of Allah (may peare be upon him) did not kill them. and thou shouldst not kill them unless thou knew what the companion of Moses (i. e. Khadir) knew about the boy he had killed. And you have written asking me about the orphan as to when the period of his orphanhood comes to an end, so that the sobriquet of" orphan" is dropped from him. (In this regard, you should know that) the sobriquet" orphan" will not be dropped from him until he attains maturity of body and mind. And you have written asking me about the close relatives (of the Holy Prophet) as to who they are. We think that it is we, but our people have denied us this (position and its concomitant privileges).
Sahih Muslim Book 32, Hadith 168