أَصْحَابُ الْكَهْفِ
People of the Cave (Ashab al-Kahf): The Complete Story from Surah Al-Kahf
At a Glance
Surah Al-Kahf, the 18th surah of the Quran
A group of young believers and their dog
Faith under trial and the certainty of resurrection
Surah Al-Kahf 18:9–26

The Story: Young Believers in a Pagan City
The story of the People of the Cave opens with a question that the people of Makkah had put to the Prophet Muhammad (peace be upon him): who were these sleepers, and what really happened to them? Allah answers directly, beginning the account with a firm statement: these were young men, fityah, who believed in their Lord when almost everyone around them did not.
They lived in a city ruled by a tyrant who demanded that his people worship idols and other gods besides Allah. Classical tafsir, such as that of Ibn Kathir, identifies this king with a persecuting Roman-era ruler, but the Quran itself does not name him or the city. What the Quran does tell us is the stand the young men took: they declared their faith openly, saying their Lord was the Lord of the heavens and the earth, and that they would never call upon any god besides Him.
That open declaration came at a cost. Staying meant facing threats, punishment, and being forced back into idol worship. So they made the hardest choice a young person can make: they left their homes, their families, and their comforts behind, and took refuge in a cave with their dog, placing their trust completely in Allah.
نَّحْنُ نَقُصُّ عَلَيْكَ نَبَأَهُم بِالْحَقِّ ۚ إِنَّهُمْ فِتْيَةٌ آمَنُوا بِرَبِّهِمْ وَزِدْنَاهُمْ هُدًى
Nahnu naqussu ‘alayka naba’ahum bil-haqq. Innahum fityatun amanoo birabbihim wa zidnahum huda.
We narrate to you their story in truth. Truly, they were youths who believed in their Lord, and We increased them in guidance. (18:13)
ہم تمہیں ان کا قصہ سچائی کے ساتھ سناتے ہیں۔ بیشک وہ نوجوان تھے جو اپنے رب پر ایمان لائے تھے، اور ہم نے انہیں ہدایت میں اور بڑھا دیا۔
The Prayer That Started Everything
One of the most moving details of the story is the very first thing the young men did when they reached the cave. They did not complain or despair. They raised their hands in dua and asked Allah for two things: mercy from Him, and right guidance through their trial. Allah recorded their exact words in the Quran so that every believer after them could repeat them in times of hardship.
This dua is short enough to memorize in a day, and it carries the spirit of the whole story: when you cannot control the situation, ask the One who controls everything. The young men could not defeat a king, but they could ask the King of kings for mercy, and they did.
إِذْ أَوَى الْفِتْيَةُ إِلَى الْكَهْفِ فَقَالُوا رَبَّنَا آتِنَا مِن لَّدُنكَ رَحْمَةً وَهَيِّئْ لَنَا مِنْ أَمْرِنَا رَشَدًا
Idh awal-fityatu ilal-kahfi faqaloo rabbana atina min ladunka rahmatan wa hayyi’ lana min amrina rashada.
When the youths took refuge in the cave, they said: Our Lord, grant us mercy from Yourself and guide us rightly through our ordeal. (18:10)
جب ان نوجوانوں نے غار میں پناہ لی تو کہا: اے ہمارے رب! ہمیں اپنی طرف سے رحمت عطا فرما اور ہمارے معاملے میں ہماری رہنمائی فرما۔
A Sleep of 309 Years
Allah answered their prayer in a way no one could have imagined. He cast a deep sleep over them in the cave, and they slept for centuries while the world outside went on without them. The sun, the Quran tells us, turned away from their cave as it rose and set, a sign that even nature was arranged to protect them.
Their dog lay stretched out at the entrance of the cave, and anyone who had stumbled upon them would have been overcome with fear at the sight. Allah Himself was their guard: no enemy could reach them, and no harm could touch them, because their sleep was under His direct protection.
How long did they sleep? The Quran gives the figure plainly: three hundred years, and nine more. Scholars note that the extra nine accounts for the difference between solar and lunar reckoning, but the point is not the arithmetic. The point is that Allah, who made them sleep for centuries without food or water, can just as easily bring the dead back to life. That was the lesson the whole event was designed to teach.
وَلَبِثُوا فِي كَهْفِهِمْ ثَلَاثَ مِائَةٍ سِنِينَ وَازْدَادُوا تِسْعًا
Wa labithoo fee kahfihim thalatha mi’atin sineen, wazdadoo tis’a.
And they remained in their cave for three hundred years, adding nine. (18:25)
اور وہ اپنے غار میں تین سو سال رہے اور نو سال اور بڑھا لیے۔
The Awakening
When Allah finally woke them, they had no idea how much time had passed. They asked one another, “How long have we stayed?” and guessed, “A day, or part of a day.” Then, realizing they could not know, they left the matter to Allah, the same trust they had shown from the very beginning.
Hungry after their long sleep, they sent one of their number into the city with some silver coins to buy the purest food, warning him to be careful and discreet. He walked into a world that had completely changed. The coins he carried were centuries old, and they gave him away at once.
The people of the city soon learned who these young men were. By then, the tyrant was long gone, and the new generation believed in Allah. Their awakening settled a debate that had troubled that generation: whether the dead would truly be resurrected. Here was living proof, young men who had slept for three centuries and woken up by Allah’s command. The Quran presents the story as a sign for those who doubted the Resurrection, and that is its central purpose.
قَالُوا لَبِثْنَا يَوْمًا أَوْ بَعْضَ يَوْمٍ
Qaloo labithna yawman aw ba’da yawm.
They said: We have remained a day, or part of a day. (18:19)
انہوں نے کہا: ہم ایک دن یا اس کا کچھ حصہ رہے ہیں۔
One point the Quran makes with deliberate care is about their number. People argued over whether they were three, five, or seven, and the Quran tells us not to get lost in that debate: “My Lord knows best their number; none knows them except a few” (18:22). The lesson of the story is their faith and Allah’s power, not the headcount. Classical tafsir reports commonly describe them as seven young men plus the dog, but the Quran leaves the exact number to Allah’s knowledge, and so should we.

Lessons We Learn
- Youth is no barrier to great faith. The Quran introduces them simply as fityah, youths, yet their certainty and courage became a sign for all of humanity.
- Righteous company protects. They went to the cave together, encouraged each other, and woke up together. Who you walk with shapes where you end up.
- Dua is the first response, not the last. Before they slept, before they were saved, they prayed, and Allah recorded their words so we can use them too.
- Allah is the best guardian. He arranged the sun, the sleep, and the dog so that no harm reached them. Trust in His protection is never misplaced.
- Resurrection is certain. If Allah can return sleepers to life after three centuries, raising the dead on the Day of Judgment is easy for Him.
- Do not argue over what Allah kept hidden. The Quran warns against endless debate about their number; focus on the lesson, not the details.
Why This Story Matters Today
Every generation has its own pressure to compromise: at school, at work, in public life. The People of the Cave show that holding onto faith when the whole society pushes the other way is not new, and it is not hopeless. When standing openly becomes impossible, stepping back to protect your faith is wisdom, not cowardice.
The story is also one of the main reasons Surah Al-Kahf is recited every Friday. It is the surah of trials: the trial of faith (the sleepers), the trial of wealth, the trial of knowledge, and the trial of power. The first of these trials is answered right here, with the promise that faith held firmly is never wasted, and that the One who woke sleepers after 309 years will surely raise us all again.
FAQ
How many were the People of the Cave?
The Quran does not give an exact number. It records that people differed, some saying three, some five, some seven, and then says: “My Lord knows best their number” (18:22). Many classical scholars, including Ibn Kathir, favored the view that they were seven youths with their dog, but the Quran deliberately leaves the matter with Allah and warns against arguing over it.
How long did they sleep in the cave?
The Quran states they stayed in their cave for three hundred years, and added nine (18:25). Scholars explain that the nine years account for the difference between the solar and lunar calendars. Their long sleep was a sign of Allah’s power to bring the dead back to life.
What is the dua of the People of the Cave?
Their dua is recorded in verse 18:10: “Rabbana atina min ladunka rahmatan wa hayyi’ lana min amrina rashada” (Our Lord, grant us mercy from Yourself and guide us rightly through our ordeal). It is a short, powerful supplication for anyone facing hardship, and it is easy to memorize.
Did their dog go to sleep with them?
Yes. The Quran mentions their dog stretching its forelegs at the entrance of the cave (18:18), and counts the dog among them when listing the possible numbers (18:22). The dog is part of the story’s imagery of complete protection: everything about them, including their companion, was guarded by Allah.
Why did Allah tell this story?
The story answers a question put to the Prophet Muhammad (peace be upon him) by the people of Makkah, who had been prompted to test him with it. Its purpose is to prove the truth of resurrection: a people who doubted the afterlife were shown sleepers who woke after three centuries. It is also a lesson in steadfast faith under persecution.
What is Ar-Raqim mentioned in 18:9?
The verse asks, “Did you think the People of the Cave and Ar-Raqim were a wonder among Our signs?” Scholars differ on what Ar-Raqim means: some say it was the name of the town or mountain where the cave was, others say it was a tablet or inscription on which the names of the sleepers were written. The Quran does not settle the matter, so the safest position is to mention the main views without insisting on one.
Final Thoughts
The People of the Cave were young, outnumbered, and hunted, yet they became immortal because they chose Allah over everything else. Their story is the Quran’s answer to everyone who feels that faith is too hard in a hostile world: take refuge in Allah, make the dua they made, and trust that the One who kept them safe in a cave for 309 years is watching over you too. When Surah Al-Kahf is recited this Friday, remember their names are not the point. Their trust is.
Continue Reading
Read the story of Dhul-Qarnain, also from Surah Al-Kahf, or the People of the Ditch, who faced the same trial of faith. Browse all stories in the Quranic Stories hub.
