1. QASAS
  2. Blog

The People of the Cave (Ashab al-Kahf): The Complete Story from Surah al-Kahf

A few young believers, a cave, a sleeping dog at the entrance and 309 years: the story exactly as the Quran tells it, explained with Ibn Kathir, al-Tabari, al-Sa'di and al-Muyassar.

By QASAS23 min read

The young men of the cave and their dog seen from behind at the mouth of the cave under the moon

The people of the cave story is one of the best-known stories in the Quran, and it gives Surah al-Kahf ("The Cave") its name. In Arabic they are called Ashab al-Kahf, the companions of the cave, and in English they are also searched for as the Sleepers of the Cave or the "Seven Sleepers". They were not prophets. They were ordinary young men who believed in their Lord at a time when their whole community had turned away from Him, and they chose to leave everything rather than give up that belief.

The Quran tells their story in eighteen ayat, from 18:9 to 18:26. It begins with a short summary, then returns to tell the details: their stand against their people, their prayer in the cave, a sleep that lasted centuries, the moment they woke, and how people found them. It ends with two lessons that reach far beyond the cave: do not argue about details Allah has not revealed, and never promise to do something tomorrow without saying "if Allah wills".

This article follows the story ayah by ayah. Every quotation of the Quran comes straight from the text, and every explanation is credited to the classical tafsir it comes from: Ibn Kathir, al-Tabari, al-Sa'di and al-Tafsir al-Muyassar. Where those scholars differed, you will see that too.

Where is the story of the People of the Cave in the Quran?

The story of the People of the Cave is in Surah al-Kahf, the 18th surah of the Quran, from ayah 9 to ayah 26. Surah al-Kahf is a Makkan surah of 110 ayat, and this is the first of its four great stories.

The other three come later in the same surah: the owner of the two gardens (18:32-44), Prophet Musa and al-Khidr (18:60-82), and Dhul-Qarnayn and the wall against Ya'juj and Ma'juj (18:83-98). Each one shows a different way of holding on to faith, and the People of the Cave come first.

Many Muslims read Surah al-Kahf every Friday, which is why this story is so familiar. Ibn Kathir opens his commentary on the surah by gathering the narrations about its virtues, including reading it on Friday, which he cites from the collections of al-Hakim and al-Bayhaqi.

Who were the People of the Cave?

The People of the Cave were young men who believed in Allah alone, and Allah strengthened their faith. The Quran introduces them with these ayat:

﴿نَّحْنُ نَقُصُّ عَلَيْكَ نَبَأَهُم بِٱلْحَقِّ ۚ إِنَّهُمْ فِتْيَةٌ ءَامَنُوا۟ بِرَبِّهِمْ وَزِدْنَـٰهُمْ هُدًى ١٣ وَرَبَطْنَا عَلَىٰ قُلُوبِهِمْ إِذْ قَامُوا۟ فَقَالُوا۟ رَبُّنَا رَبُّ ٱلسَّمَـٰوَٰتِ وَٱلْأَرْضِ لَن نَّدْعُوَا۟ مِن دُونِهِۦٓ إِلَـٰهًا ۖ لَّقَدْ قُلْنَآ إِذًا شَطَطًا ١٤ هَـٰٓؤُلَآءِ قَوْمُنَا ٱتَّخَذُوا۟ مِن دُونِهِۦٓ ءَالِهَةً ۖ لَّوْلَا يَأْتُونَ عَلَيْهِم بِسُلْطَـٰنٍۭ بَيِّنٍ ۖ فَمَنْ أَظْلَمُ مِمَّنِ ٱفْتَرَىٰ عَلَى ٱللَّهِ كَذِبًا ١٥ وَإِذِ ٱعْتَزَلْتُمُوهُمْ وَمَا يَعْبُدُونَ إِلَّا ٱللَّهَ فَأْوُۥٓا۟ إِلَى ٱلْكَهْفِ يَنشُرْ لَكُمْ رَبُّكُم مِّن رَّحْمَتِهِۦ وَيُهَيِّئْ لَكُم مِّنْ أَمْرِكُم مِّرْفَقًا ١٦﴾

(13) It is We who relate to you, [O Muḥammad], their story in truth. Indeed, they were youths who believed in their Lord, and We increased them in guidance. (14) And We bound [i.e., made firm] their hearts when they stood up and said, "Our Lord is the Lord of the heavens and the earth. Never will we invoke besides Him any deity. We would have certainly spoken, then, an excessive transgression. (15) These, our people, have taken besides Him deities. Why do they not bring for [worship of] them a clear evidence? And who is more unjust than one who invents about Allāh a lie?" (16) [The youths said to one another], "And when you have withdrawn from them and that which they worship other than Allāh, retreat to the cave. Your Lord will spread out for you of His mercy and will prepare for you from your affair facility."

Surah Al-Kahf (18:13–16) · Saheeh International

Allah describes them as “youths who believed in their Lord, and We increased them in guidance” (Quran 18:13). Ibn Kathir explains that the word fityah means young men, and that young people are often quicker to accept the truth than those who have grown set in a false way. He also points out that the words “We increased them in guidance” (Quran 18:13) are one of the ayat scholars use to show that faith can grow stronger.

Al-Sa'di adds a linguistic detail: fityah is a plural used for a small number, which suggests they were fewer than ten. He explains that because they believed sincerely, Allah rewarded them with more guidance, meaning more beneficial knowledge and more righteous action.

Then comes their stand. “And We bound [i.e., made firm] their hearts” (Quran 18:14) when they stood up and declared “Our Lord is the Lord of the heavens and the earth” (Quran 18:14). Al-Tafsir al-Muyassar explains that they said this while standing before the disbelieving king of their people, who blamed them for leaving the worship of idols. Ibn Kathir relays from earlier commentators that their people had a tyrant king who called everyone to worship idols and offer sacrifices to them. The Quran itself does not name this king, and the names given in later reports are not something we need.

Al-Sa'di draws out the strength of their argument. They reasoned from the fact that Allah alone created the heavens and the earth to the conclusion that He alone deserves worship. Then they turned the question back on their people: “Why do they not bring for [worship of] them a clear evidence?” (Quran 18:15) Idols that cannot create anything have no proof behind them.

Were they prophets? No. Nothing in the Quran or the classical tafsir describes the People of the Cave as prophets or messengers. They were believers, young men of faith, and that is exactly what makes their story so close to ordinary people.

Leaving their people and the du'a in the cave

The young men decided to leave their people and take shelter in a cave, and as they entered it they made a famous du'a. The Quran gives the scene right at the start of the story:

﴿أَمْ حَسِبْتَ أَنَّ أَصْحَـٰبَ ٱلْكَهْفِ وَٱلرَّقِيمِ كَانُوا۟ مِنْ ءَايَـٰتِنَا عَجَبًا ٩ إِذْ أَوَى ٱلْفِتْيَةُ إِلَى ٱلْكَهْفِ فَقَالُوا۟ رَبَّنَآ ءَاتِنَا مِن لَّدُنكَ رَحْمَةً وَهَيِّئْ لَنَا مِنْ أَمْرِنَا رَشَدًا ١٠﴾

(9) Or have you thought that the companions of the cave and the inscription were, among Our signs, a wonder? (10) [Mention] when the youths retreated to the cave and said, "Our Lord, grant us from Yourself mercy and prepare for us from our affair right guidance."

Surah Al-Kahf (18:9–10) · Saheeh International

Before they went, they encouraged one another: “Your Lord will spread out for you of His mercy” (Quran 18:16). Al-Muyassar explains that they withdrew to a cave in the mountain so they could worship their Lord alone, trusting that He would cover them with His mercy and make their affairs easy.

Ibn Kathir describes them as young men who fled with their religion from their people so that they would not be forced away from it. When they entered the cave, they asked Allah for His mercy and kindness. His explanation of their du'a is beautiful in its simplicity: “grant us from Yourself mercy” (Quran 18:10) means mercy that protects them and hides them from their people, and “prepare for us from our affair right guidance” (Quran 18:10) means: make the outcome of this affair of ours a good and right one.

The young men of the cave raising their hands in du'a, seen from behind
The young men of the cave raising their hands in du'a, seen from behind

Al-Sa'di notices something important in the way they acted. They combined two things: they took practical action by escaping the trial to a place where they could hide, and they humbly turned to Allah, asking Him to make their affairs easy. They did not rely on themselves or on anyone else. "That is why," he writes, "Allah answered their prayer."

The du'a itself, “Our Lord, grant us from Yourself mercy and prepare for us from our affair right guidance.” (Quran 18:10), is one that Muslims still make today at moments of uncertainty: before a journey, a decision or a difficult change.

The young men and their dog climbing toward a remote cave in the mountains, seen from behind
The young men and their dog climbing toward a remote cave in the mountains, seen from behind

The long sleep: the sun, the turning and the dog

Allah made them fall into a deep sleep that lasted for years, and He protected their bodies the whole time. The Quran says simply: “So We cast [a cover of sleep] over their ears within the cave for a number of years” (Quran 18:11). Al-Muyassar explains this as a deep sleep in which they remained in the cave for many years. Then the Quran paints one of its most vivid scenes:

﴿۞ وَتَرَى ٱلشَّمْسَ إِذَا طَلَعَت تَّزَٰوَرُ عَن كَهْفِهِمْ ذَاتَ ٱلْيَمِينِ وَإِذَا غَرَبَت تَّقْرِضُهُمْ ذَاتَ ٱلشِّمَالِ وَهُمْ فِى فَجْوَةٍ مِّنْهُ ۚ ذَٰلِكَ مِنْ ءَايَـٰتِ ٱللَّهِ ۗ مَن يَهْدِ ٱللَّهُ فَهُوَ ٱلْمُهْتَدِ ۖ وَمَن يُضْلِلْ فَلَن تَجِدَ لَهُۥ وَلِيًّا مُّرْشِدًا ١٧ وَتَحْسَبُهُمْ أَيْقَاظًا وَهُمْ رُقُودٌ ۚ وَنُقَلِّبُهُمْ ذَاتَ ٱلْيَمِينِ وَذَاتَ ٱلشِّمَالِ ۖ وَكَلْبُهُم بَـٰسِطٌ ذِرَاعَيْهِ بِٱلْوَصِيدِ ۚ لَوِ ٱطَّلَعْتَ عَلَيْهِمْ لَوَلَّيْتَ مِنْهُمْ فِرَارًا وَلَمُلِئْتَ مِنْهُمْ رُعْبًا ١٨﴾

(17) And [had you been present], you would see the sun when it rose, inclining away from their cave on the right, and when it set, passing away from them on the left, while they were [lying] within an open space thereof. That was from the signs of Allāh. He whom Allāh guides is the [rightly] guided, but he whom He sends astray - never will you find for him a protecting guide. (18) And you would think them awake, while they were asleep. And We turned them to the right and to the left, while their dog stretched his forelegs at the entrance. If you had looked at them, you would have turned from them in flight and been filled by them with terror.

Surah Al-Kahf (18:17–18) · Saheeh International

The sun. When the sun rose, it inclined away from the cave to the right, and when it set, it passed them by on the left, while they lay in a wide open space inside. Ibn Kathir reasons from this that the mouth of the cave faced north. Al-Sa'di explains the mercy behind it: the heat of the sun never reached them to harm their bodies, and the open space let fresh air reach them through the long years. The Quran calls this “from the signs of Allāh” (Quran 18:17).

Ibn Kathir then makes a point worth remembering. Allah described the cave for us but did not tell us where it is, "since there is no benefit for us in that, and no religious purpose." He mentions that some commentators went to great lengths to name places, and concludes that Allah knows best in which land it is. If knowing it had brought us any religious benefit, we would have been told.

Awake yet asleep. “And you would think them awake, while they were asleep” (Quran 18:18). Ibn Kathir and al-Sa'di both report the explanation of the commentators that their eyes stayed open, so that anyone looking at them would think they were awake.

Turned right and left. Allah turned them onto their right sides and their left sides. Ibn Kathir reports from the early commentators that if they had not been turned, the ground would have worn away their bodies. Al-Sa'di adds a subtle lesson: Allah could have preserved them without any turning at all, but in His wisdom He let the normal laws of His creation run, linking causes to their effects.

The dog at the entrance. “their dog stretched his forelegs at the entrance” (Quran 18:18). Ibn Kathir explains that al-wasid is the threshold or the courtyard at the door of the cave. The dog lay there as dogs do, as if guarding them, and it shared in the same sleep. Ibn Kathir sees a lesson in this: the blessing of the righteous reached even their dog, which is now mentioned in the Quran. That, he says, is the benefit of keeping good company.

The awe. Finally, anyone who looked in would have fled in terror. Ibn Kathir explains that Allah clothed them in awe so that no one would come near them or touch them until the appointed time. Al-Sa'di sums it up: the turning protected them from the earth, and the awe protected them from people, even though the cave was close enough to the city to send someone there for food.

The young men asleep in the cave while the light of the sun turns away from them, seen from behind
The young men asleep in the cave while the light of the sun turns away from them, seen from behind

Waking up and the silver coin

After the long sleep, Allah woke them, and their first question was how long they had slept. The Quran tells the conversation:

﴿وَكَذَٰلِكَ بَعَثْنَـٰهُمْ لِيَتَسَآءَلُوا۟ بَيْنَهُمْ ۚ قَالَ قَآئِلٌ مِّنْهُمْ كَمْ لَبِثْتُمْ ۖ قَالُوا۟ لَبِثْنَا يَوْمًا أَوْ بَعْضَ يَوْمٍ ۚ قَالُوا۟ رَبُّكُمْ أَعْلَمُ بِمَا لَبِثْتُمْ فَٱبْعَثُوٓا۟ أَحَدَكُم بِوَرِقِكُمْ هَـٰذِهِۦٓ إِلَى ٱلْمَدِينَةِ فَلْيَنظُرْ أَيُّهَآ أَزْكَىٰ طَعَامًا فَلْيَأْتِكُم بِرِزْقٍ مِّنْهُ وَلْيَتَلَطَّفْ وَلَا يُشْعِرَنَّ بِكُمْ أَحَدًا ١٩ إِنَّهُمْ إِن يَظْهَرُوا۟ عَلَيْكُمْ يَرْجُمُوكُمْ أَوْ يُعِيدُوكُمْ فِى مِلَّتِهِمْ وَلَن تُفْلِحُوٓا۟ إِذًا أَبَدًا ٢٠﴾

(19) And similarly, We awakened them that they might question one another. Said a speaker from among them, "How long have you remained [here]?" They said, "We have remained a day or part of a day." They said, "Your Lord is most knowing of how long you remained. So send one of you with this silver coin of yours to the city and let him look to which is the best of food and bring you provision from it and let him be cautious. And let no one be aware of you. (20) Indeed, if they come to know of you, they will stone you or return you to their religion. And never would you succeed, then - ever."

Surah Al-Kahf (18:19–20) · Saheeh International

One of them asked how long they had stayed, and the others answered “We have remained a day or part of a day” (Quran 18:19). Ibn Kathir explains that they had entered the cave early in the day and woke at the end of a day, so it felt like a single day. But something made them hesitate, so they said “Your Lord is most knowing of how long you remained” (Quran 18:19). Al-Sa'di calls this a model of good manners in knowledge: when something is unclear, you return it to the One who knows everything.

Then they turned to what mattered most: food. They sent one of them to the city with their silver coins. Ibn Kathir explains that they had brought these coins from their homes. They asked him to find the purest food, which Ibn Kathir explains means the most wholesome and lawful, and to be careful and discreet, “let him be cautious” (Quran 18:19), so that no one would find out about them.

Their fear was real. As far as they knew, their people were still the same people who had threatened them: “they will stone you or return you to their religion” (Quran 18:20). Al-Sa'di points out several practical lessons from these two ayat: the value of discussing a matter to reach the truth, the permission to send someone to buy and sell on your behalf, and the permission to enjoy good, lawful food without extravagance.

Discovered as a sign that Allah's promise is true

Allah let the people of that later time discover the young men, so that they would know with certainty that resurrection is real. The Quran says:

﴿وَكَذَٰلِكَ أَعْثَرْنَا عَلَيْهِمْ لِيَعْلَمُوٓا۟ أَنَّ وَعْدَ ٱللَّهِ حَقٌّ وَأَنَّ ٱلسَّاعَةَ لَا رَيْبَ فِيهَآ إِذْ يَتَنَـٰزَعُونَ بَيْنَهُمْ أَمْرَهُمْ ۖ فَقَالُوا۟ ٱبْنُوا۟ عَلَيْهِم بُنْيَـٰنًا ۖ رَّبُّهُمْ أَعْلَمُ بِهِمْ ۚ قَالَ ٱلَّذِينَ غَلَبُوا۟ عَلَىٰٓ أَمْرِهِمْ لَنَتَّخِذَنَّ عَلَيْهِم مَّسْجِدًا ٢١﴾

(21) And similarly, We caused them to be found that they [who found them] would know that the promise of Allāh is truth and that of the Hour there is no doubt. [That was] when they disputed among themselves about their affair and [then] said, "Construct over them a structure. Their Lord is most knowing about them." Said those who prevailed in the matter, "We will surely take [for ourselves] over them a masjid."

Surah Al-Kahf (18:21) · Saheeh International

Allah says He caused them to be found “that the promise of Allāh is truth and that of the Hour there is no doubt” (Quran 18:21). Ibn Kathir reports from several early scholars that the people of that time had doubts about resurrection and the Day of Judgement. Some of them, he relates, accepted that souls would be raised but denied that bodies would be. The young men, who had slept for centuries and woke up with their bodies unchanged, as Ibn Kathir describes them, were a living proof.

Al-Muyassar explains that they were discovered after the seller noticed the kind of coins their messenger brought, and that after their matter became known and they died, the people disputed about what to do. One group said: build a structure over them and leave them, “Their Lord is most knowing about them.” (Quran 18:21) Ibn Kathir explains this as sealing the entrance of the cave and leaving them as they were. Those with power and influence said they would take a place of worship over them.

Ibn Kathir questions whether the people who said this were praiseworthy, since Islam forbids taking graves as places of worship. Al-Sa'di states plainly that what they did is forbidden, and that the Quran mentioning their words here does not mean it approves of them; it shows how highly the people came to regard the young men, who had once feared being found at all.

Al-Sa'di closes this part with a moving reflection. Whoever flees with their faith from trials, Allah keeps them safe. Whoever seeks refuge with Allah, Allah gives them refuge and makes them a guidance for others. And whoever bears hardship for Allah's sake ends up with honour from where they never expected.

How many were the People of the Cave?

The Quran mentions three numbers, describes the first two as guesswork about the unseen, and teaches that Allah knows best. This is the ayah:

﴿سَيَقُولُونَ ثَلَـٰثَةٌ رَّابِعُهُمْ كَلْبُهُمْ وَيَقُولُونَ خَمْسَةٌ سَادِسُهُمْ كَلْبُهُمْ رَجْمًۢا بِٱلْغَيْبِ ۖ وَيَقُولُونَ سَبْعَةٌ وَثَامِنُهُمْ كَلْبُهُمْ ۚ قُل رَّبِّىٓ أَعْلَمُ بِعِدَّتِهِم مَّا يَعْلَمُهُمْ إِلَّا قَلِيلٌ ۗ فَلَا تُمَارِ فِيهِمْ إِلَّا مِرَآءً ظَـٰهِرًا وَلَا تَسْتَفْتِ فِيهِم مِّنْهُمْ أَحَدًا ٢٢﴾

(22) They [i.e., people] will say there were three, the fourth of them being their dog; and they will say there were five, the sixth of them being their dog - guessing at the unseen; and they will say there were seven, and the eighth of them was their dog. Say, [O Muḥammad], "My Lord is most knowing of their number. None knows them except a few. So do not argue about them except with an obvious argument and do not inquire about them among [the speculators] from anyone."

Surah Al-Kahf (18:22) · Saheeh International

People said three with their dog as the fourth, five with their dog as the sixth, and seven with their dog as the eighth. Ibn Kathir explains the subtle hint in the wording: the first two sayings are followed by “guessing at the unseen” (Quran 18:22), which weakens them, while the third is mentioned without that description. He concludes that this indicates the third saying is the correct one. Al-Sa'di says the same, adding "and Allah knows best."

Ibn Kathir also reports, through chains he describes as authentic, that the early commentator Ibn 'Abbas said he was one of the "few" mentioned in the ayah who know their number, and that they were seven.

Yet the ayah's main teaching is about attitude, not arithmetic: “My Lord is most knowing of their number. None knows them except a few.” (Quran 18:22) Ibn Kathir explains that the best approach in such matters is to return the knowledge to Allah. Al-Sa'di calls the number "a disagreement under which there is no benefit," and warns that long arguments about such questions waste time and harm the friendship between hearts. The ayah also says not to ask the speculators about them, because, as Ibn Kathir explains, what they have is guesswork, not knowledge.

This is also why the names of the young men and the name of their dog, which appear in some reports, are not part of this article. Ibn Kathir says of those names that their authenticity is doubtful and that most of it was taken from the People of the Book. The Quran gave us what we need.

The lesson of "in sha Allah"

In the middle of the story, the Quran teaches a rule for every believer: never say you will do something tomorrow without adding "if Allah wills".

﴿وَلَا تَقُولَنَّ لِشَا۟ىْءٍ إِنِّى فَاعِلٌ ذَٰلِكَ غَدًا ٢٣ إِلَّآ أَن يَشَآءَ ٱللَّهُ ۚ وَٱذْكُر رَّبَّكَ إِذَا نَسِيتَ وَقُلْ عَسَىٰٓ أَن يَهْدِيَنِ رَبِّى لِأَقْرَبَ مِنْ هَـٰذَا رَشَدًا ٢٤﴾

(23) And never say of anything, "Indeed, I will do that tomorrow," (24) Except [when adding], "If Allāh wills." And remember your Lord when you forget [it] and say, "Perhaps my Lord will guide me to what is nearer than this to right conduct."

Surah Al-Kahf (18:23–24) · Saheeh International

Ibn Kathir explains that this is guidance in good manners: when you resolve to do something in the future, you return it to the will of Allah, the Knower of the unseen. Al-Sa'di adds that although the command was addressed first to the Prophet Muhammad ﷺ, it applies to everyone. Saying “Indeed, I will do that tomorrow” (Quran 18:23) on its own is speaking about a future no one knows, while mentioning Allah's will brings ease and blessing to the matter.

And if you forget? “And remember your Lord when you forget” (Quran 18:24). Al-Sa'di explains that you say it as soon as you remember, and that remembering Allah is itself a cure for forgetfulness. The ayah ends with a hopeful prayer: that Allah will guide us to what is even closer to right conduct.

Notice how naturally this lesson fits here. The young men had just said “Your Lord is most knowing” (Quran 18:19). The story teaches the same humility to its readers: we do not know the number, we do not know tomorrow, and we hand both to Allah.

How long did the People of the Cave sleep?

The People of the Cave stayed in their cave for 309 years, as the Quran states: “three hundred years and exceeded by nine” (Quran 18:25).

﴿وَلَبِثُوا۟ فِى كَهْفِهِمْ ثَلَـٰثَ مِا۟ئَةٍ سِنِينَ وَٱزْدَادُوا۟ تِسْعًا ٢٥ قُلِ ٱللَّهُ أَعْلَمُ بِمَا لَبِثُوا۟ ۖ لَهُۥ غَيْبُ ٱلسَّمَـٰوَٰتِ وَٱلْأَرْضِ ۖ أَبْصِرْ بِهِۦ وَأَسْمِعْ ۚ مَا لَهُم مِّن دُونِهِۦ مِن وَلِىٍّ وَلَا يُشْرِكُ فِى حُكْمِهِۦٓ أَحَدًا ٢٦﴾

(25) And they remained in their cave for three hundred years and exceeded by nine. (26) Say, "Allāh is most knowing of how long they remained. He has [knowledge of] the unseen [aspects] of the heavens and the earth. How Seeing is He and how Hearing! They have not besides Him any protector, and He shares not His legislation with anyone."

Surah Al-Kahf (18:25–26) · Saheeh International

Ibn Kathir explains why the Quran gives three hundred years and then adds nine: 309 lunar years equal 300 solar years, because the difference between lunar and solar years is about three years every century. Al-Muyassar likewise says they remained asleep for three hundred and nine lunar years.

Here the scholars recorded a difference of opinion. Al-Tabari reports that the early scholar Qatada thought ayah 25 was quoting what people said, and that the next ayah, “Allāh is most knowing of how long they remained” (Quran 18:26), was a reply to them. But al-Tabari himself chose the other view: that 309 years is Allah's own statement, because the ayah begins as a direct statement with nothing to show it is quoting anyone. Ibn Kathir agrees with al-Tabari, and adds that if it were a quotation, the addition of nine would not fit.

So what does ayah 26 mean? Ibn Kathir explains: if you are asked about such a matter and have no knowledge from Allah, do not put yourself forward; say that Allah knows best. Al-Tabari offers another explanation: Allah knows best how long has passed since they died until now. Either way, the ayah closes the question with Allah's perfect knowledge, and al-Sa'di adds that it was Allah alone who took care of the People of the Cave, without leaving them to any of His creation.

What is al-Raqim?

Al-Raqim is mentioned once, in 18:9, where Allah speaks of “the companions of the cave and the inscription” (Quran 18:9), and the classical scholars differed about what it means. Ibn Kathir and al-Tabari record several opinions from the early commentators:

Ibn Kathir says the last meaning, the written record, is the apparent meaning of the ayah, and that it was al-Tabari's choice: raqim is on the pattern that means marqum, "something written". Al-Sa'di and al-Muyassar also explain it as a tablet or book in which their names and story were inscribed. That is why Saheeh International translates it as "the inscription". Even so, Ibn Kathir reports that one of the earliest commentators admitted he did not know whether it was a book or a building, an honest reminder that not every detail is known.

The ayah itself carries a lesson. Allah asks whether we think the People of the Cave were the most amazing of His signs. Al-Sa'di explains that the story is truly amazing, but that the creation of the heavens and the earth is even greater, so a believer should reflect on all of Allah's signs, not stop at one.

The Sleepers of the CaveWatch this story in QASASThe Sleepers of the CaveYoung men fled a tyrant king and slept for 309 years.Open on Google Play →

Timeline of the story

StageWhat happensAyat
SummaryAllah introduces the companions of the cave and al-Raqim as one of His signs18:9-12
Their faithYoung men believe in their Lord and Allah increases their guidance18:13
Their standThey declare that their Lord is the Lord of the heavens and the earth18:14-15
The decisionThey withdraw from their people and their idols and head for the cave18:16
The du'aInside the cave they ask Allah for mercy and right guidance18:10
The sleepAllah makes them sleep; the sun turns away; they are turned right and left; the dog lies at the entrance18:11, 18:17-18
WakingThey ask how long they slept and send one of them with silver coins to the city18:19-20
DiscoveryPeople find them and learn that Allah's promise and the Hour are true18:21
The numberThree sayings; the Quran says Allah knows best18:22
In sha AllahNever promise "tomorrow" without "if Allah wills"18:23-24
The duration300 years and nine more; Allah knows best18:25-26

Lessons from the story of the People of the Cave

  1. Faith is worth protecting. The young men left their homes and comforts rather than worship anything besides Allah.
  2. Take action and make du'a together. As al-Sa'di notes, they both left the place of trial and asked Allah for help, and that is why their prayer was answered.
  3. Allah strengthens those who take the first step. They believed, and Allah gave them more guidance and made their hearts firm.
  4. Good company matters. They stood together, and even their dog was blessed by being with them, as Ibn Kathir observes.
  5. Allah's care is in the details. The angle of the sun, the open space, the turning of their bodies and the awe around them were all part of His protection.
  6. Resurrection is real. Their waking was a sign that the promise of Allah is true and that the Hour will come.
  7. Do not argue over what brings no benefit. The number, the names and the place are left with Allah; the meaning of the story is what we need.
  8. Say "in sha Allah". Every plan for tomorrow belongs to Allah's will.
  9. Return what you do not know to Allah. “Your Lord is most knowing” (Quran 18:19) was their answer, and “Allāh is most knowing of how long they remained” (Quran 18:26) is the Quran's.
  10. Young people can be heroes of faith. The Quran honours a group of youths, not kings or scholars, for their courage.

This is the same courage seen in Prophet Musa standing before Pharaoh, the same patience seen in Prophet Yusuf's long trials, and the same turning to Allah in a dark, enclosed place seen in Prophet Yunus inside the whale.

One of the four stories of Surah al-Kahf

The People of the Cave open a surah that holds four stories, each teaching how to hold on to faith through a different trial. After the youths of the cave comes a man proud of his two gardens, who forgot that his wealth came from Allah. Then comes Prophet Musa (peace be upon him), who travelled to learn from al-Khidr and saw three actions he could not understand until their wisdom was revealed. The surah closes its stories with Dhul-Qarnayn, a just ruler given power on earth who built a barrier against Ya'juj and Ma'juj and credited it all to his Lord's mercy.

QASAS has two of these as cinematic stories of their own, "Musa and al-Khidr" and "Dhul-Qarnayn's Wall", so a family can watch the surah's stories one after another:

Musa and al-KhidrWatch this story in QASASMusa and al-KhidrThree acts shocked Musa, then al-Khidr revealed the secret.Open on Google Play →

Telling the story of the People of the Cave to children

The people of the cave story is one of the easiest Islamic stories for kids to love: brave young people, a hidden cave, a loyal dog and a sleep that lasted for centuries. Keep the focus on what the Quran says and let the wonder speak for itself.

A good way to start is to watch the story together in QASAS, then read it page by page and answer the short quiz at the end.

Read and watch it in QASAS

QASAS is a free prophet stories app that turns Quran stories into short cinematic episodes you can watch and read. The Sleepers of the Cave episode follows the young men from their flight to the cave, through their du'a, to the long sleep, and every story ends with a quiz for children and families.

Because the story lives in Surah al-Kahf, the app also has the full mushaf with tafsir (al-Muyassar and Ibn Kathir), translation and word by word, plus a Friday reminder to read al-Kahf. You will also find prayer times with adhan, the qibla direction and a 3D tasbih, all free, with no ads and no account. QASAS is available on Android through Google Play, and the iPhone version is coming soon.

Frequently asked questions

Who were the People of the Cave?

The People of the Cave (Ashab al-Kahf) were a small group of young men who believed in Allah alone while their people worshipped idols. To protect their faith they took refuge in a cave, where Allah made them sleep for 309 years. Their story is in Surah al-Kahf, ayat 9 to 26.

How long did the People of the Cave sleep?

They slept for 309 years, as the Quran says: “three hundred years and exceeded by nine” (Quran 18:25). Ibn Kathir explains that 309 lunar years equal 300 solar years. Al-Tabari and Ibn Kathir both hold that this number is Allah's own statement, not a quotation of what people said.

How many People of the Cave were there?

The Quran does not state the number directly, but it hints at seven with their dog as the eighth. It mentions three, five and seven, calls the first two “guessing at the unseen” (Quran 18:22) and leaves the third without that description, which Ibn Kathir and al-Sa'di take as a sign it is correct. The Quran then teaches that Allah knows their number best.

Were the People of the Cave prophets?

No, they were not prophets. The Quran describes them as “youths who believed in their Lord” (Quran 18:13): believing young men whom Allah honoured for their faith and courage.

What does al-Raqim mean in Surah al-Kahf?

Scholars differed about al-Raqim; the view Ibn Kathir calls the apparent meaning is a written tablet or book recording their story. Other early opinions said it was the name of the valley, the mountain or their town. Al-Tabari, al-Sa'di and al-Muyassar all lean to the meaning of an inscription.

Does the Quran name the young men, their dog or the place of the cave?

No, the Quran gives no names and no location. Ibn Kathir says Allah described the cave but did not tell us where it is because there is no benefit in knowing it, and that the names found in some reports are doubtful and mostly taken from the People of the Book.

What is the main lesson of the story of the People of the Cave?

The main lesson is that Allah protects those who hold on to their faith and turn to Him. The story also proves that resurrection is real, teaches us to say "in sha Allah" about the future, and warns against arguing about details Allah has not revealed.

Why do Muslims read Surah al-Kahf on Friday?

Reading Surah al-Kahf on Friday is a widely held practice among Muslims. Ibn Kathir begins his commentary on the surah with the narrations about its virtues, including reading it on Friday, citing al-Hakim and al-Bayhaqi. QASAS can remind you to read it every Friday.

Sources

The Quran, Surah al-Kahf 18:9-26 (Arabic text and Saheeh International translation). Tafsir Ibn Kathir; Tafsir al-Tabari (Jami' al-Bayan); Tafsir al-Sa'di (Taysir al-Karim al-Rahman); al-Tafsir al-Muyassar (King Fahd Complex).

Updated: · By QASAS

Free · No ads · No account

Watch and read it in QASAS

Live now on Android. The iPhone version is in Apple's review and lands very soon.

GET IT ONGoogle PlayCOMING SOON ON THEApp Store
QR code: QASAS on Google PlayScan with your Android phone to install

Watch these stories in the app

Keep reading