Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:40:25

And when he brought them the truth from Us, they said, "Kill the sons of those who have believed with him and keep their women alive." But the plan of the disbelievers is not except in error.  

So when he brought them the truth from Us, they said, ‘Slay the sons of those who believe with him, and spare, keep alive, their women’. But the guile of the disbelievers is ever in error, in perdition.
القرآن:٤٠:٢٥

فَلَمَّا جَاءَهُمْ بِالْحَقِّ مِنْ عِنْدِنَا قَالُوا اقْتُلُوا أَبْنَاءَ الَّذِينَ آمَنُوا مَعَهُ وَاسْتَحْيُوا نِسَاءَهُمْ ۚ وَمَا كَيْدُ الْكَافِرِينَ إِلَّا فِي ضَلَالٍ  

{فلما جاءهم بالحق} بالصدق {من عندنا {قالوا اقتلوا أبناء الذين آمنوا معه واستحيوا} استبقوا {نساءهم وما كيْد الكافرين إلا في ضلال} هلاك.