Where the story is told

The story is in Surah al-Kahf, Quran 18:9-26, and the surah takes its name from it. It begins with a question to the Prophet ﷺ: did you think that the companions of the cave and of the "raqim" were a wonder among Allah's signs? (Quran 18:9). The meaning of the verse is that Allah's signs in creation are far greater, and the youths are only one sign among them.

The word "raqim" is translated as an inscription, and commentators have differed about what it refers to. The Quran does not settle this.

Young believers who held to their faith

Allah describes them as youths who believed in their Lord, and He increased them in guidance (Quran 18:13). When they stood up, Allah made their hearts firm, and they said that their Lord is the Lord of the heavens and the earth and that they would never call on any deity besides Him (Quran 18:14).

They said that their people had taken other deities besides Allah, and asked why they did not bring a clear proof for them, and who is more unjust than one who invents a lie about Allah (Quran 18:15). They agreed to withdraw from their people and from what they worship besides Allah, and to take refuge in the cave, hoping that their Lord would spread His mercy over them (Quran 18:16).

At the cave they made a dua asking their Lord for mercy from Himself and right guidance in their affair (Quran 18:10).

The long sleep

Allah cast a cover of sleep over their ears in the cave for a number of years (Quran 18:11). The Quran describes how Allah cared for them: the sun rose and set away from them, they were turned to the right and to the left, and their dog stretched out its forelegs at the entrance, so that anyone looking in would think them awake and turn back in fear (Quran 18:17-18).

Allah woke them so that it would be clear which of the two groups was most precise in counting how long they had stayed (Quran 18:12).

Waking up and the silver coin

When they woke, they asked each other how long they had stayed. They said, "a day or part of a day," and then said that their Lord knows best how long they stayed (Quran 18:19). They sent one of them to the city with a silver coin to buy the best food, and told him to be careful and not let anyone know about them. They feared that if the people found them, they would stone them or force them back to their religion (Quran 18:20).

Allah caused the people to find them, so that they would know that Allah's promise is true and that there is no doubt about the Hour (Quran 18:21). The people then disputed among themselves about their matter. The Quran reports what they said, one group proposing to build a structure over them and those who prevailed proposing a place of prayer (Quran 18:21), and it adds no more.

The dispute over their number and "if Allah wills"

Quran 18:22 says that some people will say they were three, the fourth being their dog, some will say five, the sixth their dog, and some seven, the eighth their dog, all guessing at the unseen. The Prophet ﷺ is told to say that his Lord knows best their number, and that only a few know it. He is told not to argue about them except with clear proof, and not to ask the speculators about them.

The next verses give a lesson that goes beyond this story: never say that you will do something tomorrow without adding "if Allah wills", and remember your Lord when you forget (Quran 18:23-24). Quran 18:25 then says that they stayed in their cave three hundred years and added nine, and Quran 18:26 teaches that Allah knows best how long they stayed.

What the Quran does not tell us, and Surah al-Kahf in the Sunnah

The Quran does not give the names of the youths, the name of their city or their ruler, the time in which they lived, the exact number or the place of the cave. Details given in other books are not established by the Quran or the authentic Sunnah.

Authentic hadith praise Surah al-Kahf. The Prophet ﷺ said that whoever memorises ten verses from the beginning of Surah al-Kahf is protected from the Dajjal (Sahih Muslim 809). Some narrations say "from the end" of the surah. In the longer hadith about the Dajjal, he also told whoever meets him to recite its opening verses (Sahih Muslim 2937). The companion al-Bara' (may Allah be pleased with him) reported that a man recited Surah al-Kahf and a cloud covered him, and the Prophet ﷺ said that it was the sakina (tranquillity) that descended for the Quran (Sahih al-Bukhari 5011, Sahih Muslim 795).

Reciting the surah on Friday is reported in the collections of al-Hakim and al-Bayhaqi, and some scholars grade that report as authentic while others discuss its chain. It is not in Sahih al-Bukhari or Sahih Muslim, so this page gives it without a number.

Lessons from this story

  • Holding to faith may mean leaving what is wrong. The youths put their religion first and turned to Allah for mercy and guidance.
  • Allah looks after those who rely on Him. He protected the youths in the cave in a way that no one could have planned.
  • Their sleep and waking is a sign that Allah can bring the dead back to life, and that the promise of the Hour is true.
  • Do not waste effort on details that Allah has not told us. The Quran teaches us to say that Allah knows best how many they were and how long they stayed.
  • Say "if Allah wills" when you speak about the future. Our plans depend on Allah's will, and we should remember Him when we forget.

General information for learning, not a fatwa. For your own situation, ask a qualified scholar.

Sources