The short answer
The Prophet Muhammad, peace be upon him, told the narration of the boy and the king, recorded in Sahih Muslim 3005. A king sends a boy to learn magic. The boy cures the blind, and says that only Allah cures. The Tirmidhi version is graded differently, and this page leaves that open.
Who appears in the narration?
The narration gives a king, his court magician, a boy sent to learn magic, a monk whom the boy meets on the way, a blind courtier of the king, the king's men, a woman with a child, and a crowd. It gives no names, no town and no era. 1
The story in four pictures
1Two ways
A boy sent to learn magic sat with a monk on the way, and was impressed.
2The stone
A huge beast blocked the road. The boy prayed, threw a stone, and the beast died.
3The arrow
The king shot the arrow. Three times the people said they affirmed faith in the boy's Lord.
4The ditch
The king had fires lit in ditches dug in the path. The people did not renounce their faith.
What does the narration say?
Suhaib, may Allah be pleased with him, reported the Prophet's words. The retelling below is in our own words, from the stored text of the narration. Anything the narration leaves unsaid is marked as unspecified. 1
- The magician and the monk. When the magician grew old, he asked the king for a young boy to teach. On the way to the magician, the boy sat with a monk and was impressed by his words. He came late to the magician, who beat him, so he complained to the monk. The monk told him to say that his family had kept him when he feared the magician, and that the magician had kept him when he feared his family. 1
- The beast on the road. A huge beast blocked the road and held the people back. The boy said he would learn whether the magician or the monk was the greater. He picked up a stone and prayed that, if the monk's way was dearer to Allah, the beast would die. It died, and the people went on. The monk told him that he was now better than the monk, that he would be tested, and that if he was tested he should not point to the monk. 1
- The healing. The boy cured the blind and those with leprosy, and treated people for other illnesses. A blind courtier of the king heard of him and came with many gifts. The boy said he cured no one, and that Allah cures. If the courtier affirmed faith in Allah, the boy would ask Allah to cure him. The courtier did, and was cured, and sat with the king again. When the king asked who had restored his sight, he said his Lord, and the king took hold of him and tortured him until he named the boy. 1
- The monk and the courtier. The boy was brought to the king, who asked him about his cures. The boy gave the same answer, and the king tortured him until he named the monk. The monk was told to turn back from his religion and refused, and the king had him killed with a saw. The courtier was then asked to turn back, refused, and was killed in the same way. 1
- The mountain and the sea. The boy was handed to some of the king's men, with orders to take him up a mountain and throw him off if he would not renounce his faith. He prayed that Allah would save him from them however Allah willed. The mountain shook, the men fell, and the boy walked back to the king. The king then sent him out on a boat in the middle of the sea with the same order. He prayed in the same way, the boat capsized, and they drowned. He walked back to the king again. 1
- The boy's instruction to the king. The boy told the king that the king could kill him only by one public shooting, made in the name of Allah, the Lord of the boy. The king did this. The arrow struck the boy's temple, and he died. 1
A note on the boy's instruction. This part is reported as the narration gives it: the boy tells the king how he could be killed, and the king carries it out. It is not an instruction to follow, and this page does not approve it. The boy did not take his own life. This page does not present the boy's instruction as guidance. If this story has raised thoughts of harming yourself, talk to someone you trust now, or call Samaritans on 116 123 (UK, free, 24 hours). Someone affected by this story can talk it over with a person they trust, and a question about a personal situation is for a scholar you trust.
- The crowd and the ditches. The people said that they affirmed faith in the Lord of the boy, and they said it three times. The king was told that the people had affirmed their faith, and he commanded ditches to be dug at the openings of the streets. He had fires lit in them, and said that whoever did not turn back from the religion would be thrown in, or told to jump. The narration says the people went on and did not renounce their faith. 1
- The woman and the child. A woman came with her child and hesitated to go into the fire. The child told her to endure, because she was upon the truth. The narration does not say what happened to the woman and the child. 1
Not stated in the narration: the names of the boy, the king, the monk, the courtier and the magician; the place; the era; and what became of the woman and the child.
Where does it come from?
1Graded differently Sahih Muslim 3005
The narration is Sahih Muslim 3005 (sunnah.com/muslim:3005), Book 55, Hadith 93 in sunnah.com's numbering. The record holds its grade as sahih, by its place in Sahih Muslim; the "Graded differently" label above comes from the Tirmidhi wording's gradings, set out below. sunnah.com shows no separate grade line on that page. The wording was read on sunnah.com on 19 October 2026 and has not been re-checked since. The English wording is the wording sunnah.com displays; its translator and edition are unconfirmed. sunnah.com says it draws on various translators and does not name one for this passage. 1
Do the versions differ?
Yes. Jami` at-Tirmidhi 3340 tells a related story in other words. Its gradings differ, hasan gharib and sahih, as the sources list and the section below set out. There, the king's adviser is a fortune-teller (kahin) rather than a magician, and the Prophet recites the opening verses of Surah al-Buruj about the people of the ditch. The Muslim wording does not mention Surah al-Buruj. 1
The Tirmidhi version also ends with a separate report, which that version itself introduces as "it has been mentioned": that the boy was found in the time of 'Umar ibn al-Khattab, may Allah be pleased with him. This page does not state that report as fact.
The Tirmidhi version has two recorded gradings, and they differ. Al-Tirmidhi's own comment in the Arabic, in Jami` at-Tirmidhi, Vol. 5, Book 44, Hadith 3340, reads "hasan gharib", and sunnah.com separately displays a sahih grade for the same report. That is a displayed label, and the page does not say who translated the English beside it. Both are attributed in the sources list, and this page does not choose between them. The grade above applies to the Muslim wording only. 2 1
What does the narration return to?
- Cure and healing: the boy says that he cures no one and that Allah cures, and the courtier is cured after he affirms faith in Allah.
- Deliverance: the boy asks Allah to save him from the men sent against him, and the mountain shakes and the boat capsizes.
- Steadfastness: the monk, the courtier, the boy and the people at the ditch do not renounce their faith, as the narration reports.
These are observations about what the text repeats. They are not rulings. 1
What does it not mean?
- It does not name the boy, the king, the monk, the courtier, the magician, the land or the era.
- It does not teach that magic is permitted, or that magic works against Allah's decree.
- It does not endorse harming oneself or asking anyone to end your life. The narration has the king carry out the killing, and the boy's instruction is reported, not recommended.
- It does not include the Tirmidhi additions. Those are covered in "Do the versions differ?" above, and they are not part of the Muslim wording.
Applying the story to a present situation is a matter for a scholar you trust.
The story of the boy and the king raised questions for me when I first heard it, especially the way it ends. I asked an older relative, who told me to read the narration carefully and not to treat any part of it as advice to copy. That is how I read it now.
Try it: three questions
Pick an answer. Each one explains itself.
1Who shot the arrow that killed the boy?
Answer: The king. The narration says the king took an arrow, placed it in the bow and shot it, and it struck the boy's temple.
2What did the boy say when the king asked him about the cures?
Answer: He cured no one; it is Allah Who cures. The narration reports that the boy said he cured no one, and that Allah is the One Who cures.
3What did the child tell its mother at the ditch?
Answer: To be patient, for she was upon the truth. The narration says the child told her to endure, because she was upon the truth.
Questions people ask
Are the boy, the king and the monk named?
No. The narration gives no names for the boy, the king, the monk, the courtier or the magician. It gives no place or era either.
Is this the same story as the three men trapped in the cave?
No. The three men are in a different narration in Sahih al-Bukhari, about three unnamed men and a rock. The three men trapped in cave page covers that account.
Did the boy take his own life?
No. The narration has the king shoot the arrow that kills the boy. The narration reports the boy's instruction to the king, and this page does not present it as guidance or approve it.
Does the Tirmidhi version differ?
Yes. It uses different wording and links the story to Surah al-Buruj. Its grading is recorded two ways, and this page leaves that grade open. This page follows the Muslim wording only.
Sources
Every claim on this page comes from these records. Gradings are shown with the grader's name. The Tirmidhi version's grade is open.
- 1
The Prophet told of a boy sent by a king to learn from his ageing court magician, who met a monk on the way and came to believe in Allah; the boy healed people by Allah's leave, survived the king's attempts to kill him, and told the king he could only kill him by shooting an arrow before a gathered crowd while saying 'In the name of Allah, the Lord of the boy'; when the king did so and the boy died, the people declared faith in the boy's Lord, and the king had fire-filled ditches dug for those who would not renounce it.
Sahih Muslim 3005 Book 55, Hadith 93
Graded differently. Here is who graded it which way:
- SoundIncluded in Sahih Muslim, Darussalam, al-Tirmidhi
See each grading in full, with its wording and where it was given
Scholars disagree about this hadith. Here is how each graded it, so you can follow the scholar you trust.
- Sahih: Included in Sahih Muslim (consensus on authenticity)
- Sahih: Darussalam (as shown on sunnah.com for tirmidhi:3340)
- Hasan gharib: al-Tirmidhi (his own comment in the Arabic text of tirmidhi:3340)
The Muslim wording is in Sahih Muslim. The Tirmidhi wording's grade is recorded two ways and is left open on this page.
- 2
Suhaib reported that, after Asr, the Prophet was moving his lips, and told why: a prophet among the earlier prophets, amazed at his people, was given a choice between wrath and enemy attack; they chose wrath and seventy thousand died in one day. He then told the story of a king, his fortune-teller (kahin) and a boy who was sent to learn from him, the boy's meeting with a monk, the king's attempts to kill the boy, and the people of the ditch. It ends with the Quranic verses about the People of the Ditch and a report that the boy's body was found in the time of Umar.
Authentic: hasan gharib (Al-Tirmidhi); Sahih (The Darussalam edition)
Next
Join the email list
New guides by email, now and then. No spam, and you can leave at any time.
Ilmwell is free and kept going by readers. See how to support it.