Stories
The People of the Cave
Young believers in a city of idols leave their people and shelter in a cave, where God makes them sleep three hundred years and nine more, then wakes them as a sign of the resurrection. Six chapters drawn from the verses and the classical commentaries, with lessons and a quiz.

The story narration voice is machine-generated. The text is human-written and reviewed, and Quran verses are recited by a verified reciter.
Chapter 1
A Wonder Among Our Signs: How the Story Opens

In the Quran the story begins with a question that shifts the reader's angle:
Open surahSurah Al-Kahf 18:9
Verified recitation
أَمْ حَسِبْتَ أَنَّ أَصْحَٰبَ ٱلْكَهْفِ وَٱلرَّقِيمِ كَانُوا۟ مِنْ ءَايَٰتِنَا عَجَبًا
Or have you thought that the companions of the cave and the inscription were, among Our signs, a wonder?
People marvel at youths who slept for long years and then woke, and the Quran tells them this is not the most wondrous thing God has made. The heavens and the earth are greater than a sleep in a cave, and the One who created the universe is not unable to preserve sleeping bodies for centuries.
As for al-Raqim, the commentators differed. Many said it was a tablet on which their names and story were written; others said it was the name of the valley or mountain where the cave lay. Al-Tabari and Ibn Kathir report these views, and no authentic text settles the meaning.
Then the Quran gives the whole story in brief before the details:
Open surahSurah Al-Kahf 18:10-12
Verified recitation
إِذْ أَوَى ٱلْفِتْيَةُ إِلَى ٱلْكَهْفِ فَقَالُوا۟ رَبَّنَآ ءَاتِنَا مِن لَّدُنكَ رَحْمَةًۭ وَهَيِّئْ لَنَا مِنْ أَمْرِنَا رَشَدًۭا فَضَرَبْنَا عَلَىٰٓ ءَاذَانِهِمْ فِى ٱلْكَهْفِ سِنِينَ عَدَدًۭا ثُمَّ بَعَثْنَٰهُمْ لِنَعْلَمَ أَىُّ ٱلْحِزْبَيْنِ أَحْصَىٰ لِمَا لَبِثُوٓا۟ أَمَدًۭا
[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." So We cast [a cover of sleep] over their ears within the cave for a number of years. Then We awakened them that We might show which of the two factions was most precise in calculating what [extent] they had remained in time.
The first thing they said on entering the cave was a prayer, not a plan. They asked for mercy from God Himself and for right guidance in their affair. They did not know what tomorrow would bring, but they knew to whom they were turning.
"We cast over their ears" is a precise image of deep sleep: hearing is the last sense to sleep, and one whose hearing is sealed is woken by no sound. Then God raised them to show which group judged rightly how long they had stayed.
Ibn Ishaq relates in the Sira that the Quraysh asked about these youths to test the Prophet, peace be upon him. The chain of this report is weak, so it is mentioned for context, not as settled fact.
Lessons
- The whole universe is more wondrous than the sleep in the cave; nothing is beyond God
- The believer's first response to hardship is prayer before planning
- What no authentic text confirms is mentioned with caution, never asserted
Chapter 2
Youths Who Believed in Their Lord: The Decision to Leave

After the summary come the details, which the Quran introduces with words that admit no doubt:
Open surahSurah Al-Kahf 18:13-14
Verified recitation
نَّحْنُ نَقُصُّ عَلَيْكَ نَبَأَهُم بِٱلْحَقِّ ۚ إِنَّهُمْ فِتْيَةٌ ءَامَنُوا۟ بِرَبِّهِمْ وَزِدْنَٰهُمْ هُدًۭى وَرَبَطْنَا عَلَىٰ قُلُوبِهِمْ إِذْ قَامُوا۟ فَقَالُوا۟ رَبُّنَا رَبُّ ٱلسَّمَٰوَٰتِ وَٱلْأَرْضِ لَن نَّدْعُوَا۟ مِن دُونِهِۦٓ إِلَٰهًۭا ۖ لَّقَدْ قُلْنَآ إِذًۭا شَطَطًا
It is We who relate to you, [O Muhammad], their story in truth. Indeed, they were youths who believed in their Lord, and We increased them in guidance. And We 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.
"In truth" means that what the Quran tells is the true account amid the many versions people passed around. "Youths" means young people in the prime of life, and Ibn Kathir noted that the young are more open to truth than elders set in their ways.
Notice the order: they believed, God increased them in guidance, then He made their hearts firm. The first step was theirs; steadfastness after it was God's gift. To bind a heart is to strengthen it so it does not tremble before fear.
"When they stood up" was explained as standing before the king of their people to declare God's oneness, or rising from their gathering with resolve. Either way, the declaration was open: our Lord is the Lord of the heavens and the earth, and we will call on no other.
Then they spoke among themselves about their people and decided:
Open surahSurah Al-Kahf 18:15-16
Verified recitation
هَٰٓؤُلَآءِ قَوْمُنَا ٱتَّخَذُوا۟ مِن دُونِهِۦٓ ءَالِهَةًۭ ۖ لَّوْلَا يَأْتُونَ عَلَيْهِم بِسُلْطَٰنٍۭ بَيِّنٍۢ ۖ فَمَنْ أَظْلَمُ مِمَّنِ ٱفْتَرَىٰ عَلَى ٱللَّهِ كَذِبًۭا وَإِذِ ٱعْتَزَلْتُمُوهُمْ وَمَا يَعْبُدُونَ إِلَّا ٱللَّهَ فَأْوُۥٓا۟ إِلَى ٱلْكَهْفِ يَنشُرْ لَكُمْ رَبُّكُم مِّن رَّحْمَتِهِۦ وَيُهَيِّئْ لَكُم مِّنْ أَمْرِكُم مِّرْفَقًۭا
These, our people, have taken besides Him deities. Why do they not bring for [worship of] them a clear authority? And who is more unjust than one who invents about Allah a lie?" [The youths said to one another], "And when you have withdrawn from them and that which they worship other than Allah, retreat to the cave. Your Lord will spread out for you of His mercy and will prepare for you from your affair facility."
They asked their people for nothing but proof: bring clear authority for these gods. When there was none, they withdrew. The words "other than Allah" show, as the commentators said, that their people worshipped God while associating others with Him, so the youths left the idols and kept worshipping God alone.
Remarkably, they left homes and families for a narrow cave in a mountain, then described it as a place where God would spread His mercy for them. Mercy, for them, lay not in the size of the place but in the safety of their faith.
As for the name of the king they fled, the names of the youths and the name of their city, all of this was taken by commentators from the People of the Book, and none of it is established by an authentic text, so we do not rely on it here.
Lessons
- Faith is the servant's step; steadfastness after it is God's gift
- Truth asks for proof, and falsehood has no authority
- Mercy lies in the safety of one's faith, not the size of one's place
Chapter 3
In the Hollow of the Cave: The Sun, the Dog and the Long Sleep

The Quran moves from dialogue to a visible scene, as if the reader stood at the mouth of the cave:
Open surahSurah Al-Kahf 18:17-18
Verified recitation
۞ وَتَرَى ٱلشَّمْسَ إِذَا طَلَعَت تَّزَٰوَرُ عَن كَهْفِهِمْ ذَاتَ ٱلْيَمِينِ وَإِذَا غَرَبَت تَّقْرِضُهُمْ ذَاتَ ٱلشِّمَالِ وَهُمْ فِى فَجْوَةٍۢ مِّنْهُ ۚ ذَٰلِكَ مِنْ ءَايَٰتِ ٱللَّهِ ۗ مَن يَهْدِ ٱللَّهُ فَهُوَ ٱلْمُهْتَدِ ۖ وَمَن يُضْلِلْ فَلَن تَجِدَ لَهُۥ وَلِيًّۭا مُّرْشِدًۭا وَتَحْسَبُهُمْ أَيْقَاظًۭا وَهُمْ رُقُودٌۭ ۚ وَنُقَلِّبُهُمْ ذَاتَ ٱلْيَمِينِ وَذَاتَ ٱلشِّمَالِ ۖ وَكَلْبُهُم بَٰسِطٌۭ ذِرَاعَيْهِ بِٱلْوَصِيدِ ۚ لَوِ ٱطَّلَعْتَ عَلَيْهِمْ لَوَلَّيْتَ مِنْهُمْ فِرَارًۭا وَلَمُلِئْتَ مِنْهُمْ رُعْبًۭا
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 [laying] within an open space thereof. That was from the signs of Allah. He whom Allah guides is the [rightly] guided, but he whom He leaves astray - never will you find for him a protecting guide. 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.
The sun turns away from them as it rises and passes them by as it sets, so its direct heat never strikes them, while enough light and air reach them to preserve them. They lie in an open space within the cave. The commentators said this was God's arrangement, whether through the cave's position and direction or through something beyond the ordinary, which is why the scene closes with: that was from the signs of God.
Then come details that preserved the bodies. An onlooker would think them awake, said to be because their eyes were open, while they slept. God turned them right and left so that the ground would not wear their bodies away over the long sleep, as Ibn Kathir mentions.
On the threshold lay their dog, forelegs stretched at the entrance of the cave. A silent guard named in a Book recited until the Day of Resurrection, because he kept company with people of faith. Nothing authentic establishes his name or colour.
God surrounded the place with awe: had you looked at them you would have fled and been filled with terror. No one approached them throughout those years. Their protection was not a wall or an army but a dread God placed in the heart of anyone who looked.
The youths who left with nothing but their faith gained a guard in the sun, a guard in the dog and a guard in awe. Whoever gives something up for God, God replaces it with better.
Lessons
- God's care reaches small details, like the angle of the sun and the turning of a sleeper
- Keeping company with the faithful raised even a dog to lasting mention
- Whoever gives something up for God, God replaces it with better
Chapter 4
How Long Have You Stayed? Waking, the Silver Coins and the City

Then they wake, and the first thing on their minds is time:
Open surahSurah Al-Kahf 18:19-20
Verified recitation
وَكَذَٰلِكَ بَعَثْنَٰهُمْ لِيَتَسَآءَلُوا۟ بَيْنَهُمْ ۚ قَالَ قَآئِلٌۭ مِّنْهُمْ كَمْ لَبِثْتُمْ ۖ قَالُوا۟ لَبِثْنَا يَوْمًا أَوْ بَعْضَ يَوْمٍۢ ۚ قَالُوا۟ رَبُّكُمْ أَعْلَمُ بِمَا لَبِثْتُمْ فَٱبْعَثُوٓا۟ أَحَدَكُم بِوَرِقِكُمْ هَٰذِهِۦٓ إِلَى ٱلْمَدِينَةِ فَلْيَنظُرْ أَيُّهَآ أَزْكَىٰ طَعَامًۭا فَلْيَأْتِكُم بِرِزْقٍۢ مِّنْهُ وَلْيَتَلَطَّفْ وَلَا يُشْعِرَنَّ بِكُمْ أَحَدًا إِنَّهُمْ إِن يَظْهَرُوا۟ عَلَيْكُمْ يَرْجُمُوكُمْ أَوْ يُعِيدُوكُمْ فِى مِلَّتِهِمْ وَلَن تُفْلِحُوٓا۟ إِذًا أَبَدًۭا
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. 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."
Their bodies were as they had left them, so they thought they had slept a day or part of a day. The commentators said they entered the cave early in the day and woke late in the day, so they said "a day", then saw the sun had not yet set and added "or part of a day". Three centuries had passed while they counted it in hours.
But some of them brought the others back to proper humility before God: your Lord knows best how long you stayed. They wasted no time arguing over what they could not know and moved to what they could act on: hunger, food and safety.
Al-wariq is silver coinage. They had taken with them the means to buy, for their trust in God did not mean abandoning means. They asked for the purest food, meaning the most lawful and wholesome; even afraid and hungry, they would not give up what is lawful.
They told their messenger to be discreet, careful in coming, going and dealing with people, because they still believed the king they had fled ruled the city, and that discovery would mean stoning or being forced back to idolatry. They feared losing their faith more than losing their lives: you would never succeed then.
The Quran does not say what happened to the messenger in the market, but the commentators relate that he produced old coins bearing the image of a king dead for centuries, which astonished the people and revealed the matter. These details come from transmitted reports, not an authentic text.
Lessons
- What we cannot know we leave to God, rather than wasting life arguing over it
- Trust in God does not mean abandoning means, and fear does not justify giving up the lawful
- Losing one's faith is worse than losing one's life
Chapter 5
Thus We Made Their Case Known: A Sign of the Resurrection

Their case became known, and the Quran shows that the discovery itself was intended:
Open surahSurah Al-Kahf 18:21
Verified recitation
وَكَذَٰلِكَ أَعْثَرْنَا عَلَيْهِمْ لِيَعْلَمُوٓا۟ أَنَّ وَعْدَ ٱللَّهِ حَقٌّۭ وَأَنَّ ٱلسَّاعَةَ لَا رَيْبَ فِيهَآ إِذْ يَتَنَٰزَعُونَ بَيْنَهُمْ أَمْرَهُمْ ۖ فَقَالُوا۟ ٱبْنُوا۟ عَلَيْهِم بُنْيَٰنًۭا ۖ رَّبُّهُمْ أَعْلَمُ بِهِمْ ۚ قَالَ ٱلَّذِينَ غَلَبُوا۟ عَلَىٰٓ أَمْرِهِمْ لَنَتَّخِذَنَّ عَلَيْهِم مَّسْجِدًۭا
And similarly, We caused them to be found that they [who found them] would know that the promise of Allah is truth and that of the Hour there is no doubt. 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."
The commentators mention that people of that time had disputed over the resurrection: would bodies be raised, or souls alone? The answer came to them in the form of youths who slept three centuries and then rose in their bodies. The One who raised them after such an age is able to raise people from their graves.
Here the city changes. The city the youths had fled for fear of stoning had become a believing city that honoured them. They did not need to overthrow a king or fight anyone; God changed the age around them while they slept.
Then people disputed over them after their death. One group said: build a structure over them, and leave their affair to God, for their Lord knows them best. Those with power and the upper hand said: we will take a place of worship over them.
Scholars point out that the Quran reports what they said without approving it. Ibn Kathir said those who prevailed were not praiseworthy in this, and it is established in al-Bukhari and Muslim that the Prophet, peace be upon him, said: "May God curse the Jews and Christians; they took the graves of their prophets as places of worship." Building mosques over graves is forbidden in our law, and reporting the act in the story is no permission for it.
What remains is the larger meaning: the youths set out wanting nothing but the safety of their faith, and God made them a proof of the resurrection and a lasting mention in His Book.
Lessons
- The youths' sleep and rising are a tangible proof of the resurrection
- God may change everything around His servant without the servant fighting anyone
- The Quran reporting an act is not approval of it; building mosques over graves is forbidden
Chapter 6
How Many Were They and How Long Did They Stay: Three Hundred Years and Nine

The Quran closes the story with the question that occupied people more than its lessons, the number:
Open surahSurah Al-Kahf 18:22
Verified recitation
سَيَقُولُونَ ثَلَٰثَةٌۭ رَّابِعُهُمْ كَلْبُهُمْ وَيَقُولُونَ خَمْسَةٌۭ سَادِسُهُمْ كَلْبُهُمْ رَجْمًۢا بِٱلْغَيْبِ ۖ وَيَقُولُونَ سَبْعَةٌۭ وَثَامِنُهُمْ كَلْبُهُمْ ۚ قُل رَّبِّىٓ أَعْلَمُ بِعِدَّتِهِم مَّا يَعْلَمُهُمْ إِلَّا قَلِيلٌۭ ۗ فَلَا تُمَارِ فِيهِمْ إِلَّا مِرَآءًۭ ظَٰهِرًۭا وَلَا تَسْتَفْتِ فِيهِم مِّنْهُمْ أَحَدًۭا
They 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 Muhammad], "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."
The Quran calls the first two claims guessing at the unseen, meaning conjecture without knowledge, and is silent about the third. For this reason Ibn Kathir and others held that they were seven with their dog the eighth, and al-Tabari relates that Ibn Abbas, may God be pleased with him, said: I am among the few God excepted; they were seven. Even so, the method the verse teaches matters more than the number: argue about them only briefly and plainly, and do not ask those who have no knowledge.
Then comes a counsel in the middle of the story:
Open surahSurah Al-Kahf 18:23-24
Verified recitation
وَلَا تَقُولَنَّ لِشَا۟ىْءٍ إِنِّى فَاعِلٌۭ ذَٰلِكَ غَدًا إِلَّآ أَن يَشَآءَ ٱللَّهُ ۚ وَٱذْكُر رَّبَّكَ إِذَا نَسِيتَ وَقُلْ عَسَىٰٓ أَن يَهْدِيَنِ رَبِّى لِأَقْرَبَ مِنْ هَٰذَا رَشَدًۭا
And never say of anything, "Indeed, I will do that tomorrow," Except [when adding], "If Allah 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."
Youths thought they had slept a day, and it was three centuries; who, then, can be certain of what he will do tomorrow? So the believer says "if God wills" and returns every plan to his Lord's will. Ibn Ishaq relates, in a report with a weak chain, that this verse came down when the Prophet, peace be upon him, told the Quraysh "I will tell you tomorrow" without adding "if God wills".
Finally comes the duration:
Open surahSurah Al-Kahf 18:25-26
Verified recitation
وَلَبِثُوا۟ فِى كَهْفِهِمْ ثَلَٰثَ مِا۟ئَةٍۢ سِنِينَ وَٱزْدَادُوا۟ تِسْعًۭا قُلِ ٱللَّهُ أَعْلَمُ بِمَا لَبِثُوا۟ ۖ لَهُۥ غَيْبُ ٱلسَّمَٰوَٰتِ وَٱلْأَرْضِ ۖ أَبْصِرْ بِهِۦ وَأَسْمِعْ ۚ مَا لَهُم مِّن دُونِهِۦ مِن وَلِىٍّۢ وَلَا يُشْرِكُ فِى حُكْمِهِۦٓ أَحَدًۭا
And they remained in their cave for three hundred years and exceeded by nine. Say, "Allah 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."
Most commentators take this as God's own statement of how long they stayed: three hundred and nine years. Ibn Kathir notes that three hundred solar years equal three hundred and nine lunar years, hence the wording "and nine more". Then the whole matter is returned to God's knowledge: God knows best how long they stayed.
So the story ends as it began, with surrender to God's knowledge. You can read about the virtues of Surah Al-Kahf and what is authentic about reciting it on Friday; Muslim relates that whoever memorises ten verses from its beginning is protected from the Dajjal.
Lessons
- What matters in the story is its lessons, not details God left undisclosed
- The believer is never certain of what he will do tomorrow; he says, if God wills
- Knowledge of the unseen belongs to God alone, and surrender to it ends every dispute
Interactive quiz
Answer the questions below, then check your answers. No account needed.
1. What did the youths ask of their Lord when they sheltered in the cave?
2. Why did the youths withdraw from their people?
3. Where was the dog of the People of the Cave?
4. What was the wariq they sent with one of them to the city?
5. What wisdom does the Quran give for making their case known?
6. How long did the People of the Cave stay in their cave, according to the Quran?
The illustrations are our own, free of copyright restrictions, and do not depict identified religious figures.
Related stories
Data sources
- The Quran: Surah Al-Kahf 9-26
- Sahih Muslim 809: whoever memorises ten verses from the beginning of Surah Al-Kahf is protected from the Dajjal
- Tafsir al-Tabari, Jami al-Bayan
- Tafsir Ibn Kathir
- Tafsir al-Sadi, Taysir al-Karim al-Rahman


