كتاب الجهاد والسير
32  
The Book of Jihad and Expeditions
(9)
Chapter: Permissibility of killing women and children in night raids, so long as it is not done deliberately
(9)
باب جَوَازِ قَتْلِ النِّسَاءِ وَالصِّبْيَانِ فِي الْبَيَاتِ مِنْ غَيْرِ تَعَمُّدٍ ‏‏
Sahih Muslim 1745 b

It is narrated by Sa'b b. Jaththama that he said (to the Holy Prophet):

Messenger of Allah, we kill the children of the polytheists during the night raids. He said: They are from them.
حَدَّثَنَا عَبْدُ بْنُ حُمَيْدٍ، أَخْبَرَنَا عَبْدُ الرَّزَّاقِ، أَخْبَرَنَا مَعْمَرٌ، عَنِ الزُّهْرِيِّ، عَنْ عُبَيْدِ، اللَّهِ بْنِ عَبْدِ اللَّهِ بْنِ عُتْبَةَ عَنِ ابْنِ عَبَّاسٍ، عَنِ الصَّعْبِ بْنِ جَثَّامَةَ، قَالَ قُلْتُ يَا رَسُولَ اللَّهِ إِنَّا نُصِيبُ فِي الْبَيَاتِ مِنْ ذَرَارِيِّ الْمُشْرِكِينَ قَالَ ‏ "‏ هُمْ مِنْهُمْ ‏"‏ ‏.‏
Reference : Sahih Muslim 1745b
In-book reference : Book 32, Hadith 31
USC-MSA web (English) reference : Book 19, Hadith 4322
  (deprecated numbering scheme)