obliged to believe before puberty. Even if he was not subject to religious obligations, a discerning child’s disbelief is legally recognized according to most scholars. Thus, if a discerning child apostatizes, he becomes an apostate, even if his parents are believers. By scholarly consensus, he is to be disciplined for this more severely than for neglecting prayer. Under our revealed law, however, he is not put to death until he reaches puberty.
As for the boy whom al-Khidr killed, either he had reached puberty and then disbelieved, making it permissible to kill him; or he was a disbeliever before puberty, and killing him was permissible under that revealed law. He was killed to prevent him from turning his parents away from their religion, just as, under our religion, a disbelieving child may be killed if his harm to the Muslims cannot otherwise be averted.
Indeed, a child who fights the Muslims may be killed. Thus, killing a discerning disbelieving child is permissible to repel his aggression when it cannot be repelled except by killing him.
As for killing a child of believing parents who has not yet disbelieved, on the basis of knowing that upon reaching puberty he will disbelieve and lead others astray, it may be said that neither the Quran nor the Sunnah contains anything indicating this.
Yet it may also be said that the Sunnah does contain evidence for it. This includes the words of Ibn ‘Abbās to Najdah al-Harūrī when he asked him about killing boys:
“If you know concerning one of them what al-Khidr knew concerning that boy, then kill him; otherwise, do not.”
Reported by Muslim.