Interpretation of why the Boy was killed

Ibn `Abbas narrated from Ubayy bin Ka`b that the Prophet said:

«الْغُلَامُ الَّذِي قَتَلَهُ الْخَضِرُ طُبِعَ يَوْمَ طُبِعَ كَافِرًا»

(The boy Al-Khidr killed was destined to be a disbeliever from the day he was created.) It was recorded by Ibn Jarir from Ibn `Abbas. He said:

فَكَانَ أَبَوَاهُ مُؤْمِنَيْنِ فَخَشِينَآ أَن يُرْهِقَهُمَا طُغْيَـناً وَكُفْراً

(his parents were believers, and we feared he would oppress them by rebellion and disbelief) Their love for him might make them follow him in disbelief. Qatadah said, "His parents rejoiced when he was born and grieved for him when he was killed. If he had stayed alive, he would have been the cause of their doom. So let a man be content with the decree of Allah, for the decree of Allah for the believer, if he dislikes it, is better for him than if He were to decree something that he likes for him." An authentic Hadith says;

«لَا يَقْضِي اللهُ لِلْمُؤْمِنِ مِنْ قَضَاءٍ إِلَّا كَانَ خَيْرًا لَه»

(Allah does not decree anything for the believer except it is good for him.) And Allah says:

وَعَسَى أَن تَكْرَهُواْ شَيْئًا وَهُوَ خَيْرٌ لَّكُمْ

(and it may be that you dislike a thing which is good for you.) 2:216.

فَأَرَدْنَآ أَن يُبْدِلَهُمَا رَبُّهُمَا خَيْراً مِّنْهُ زَكَـوةً وَأَقْرَبَ رُحْماً

(So we intended that their Lord should exchange him for them for one better in righteousness and nearer to mercy. ) A child who was better than this one, a child for whom they would feel more compassion. This was the view of Ibn Jurayj.