Ilmwell

Ashab e Kahf: the People of the Cave, the Quranic account

Surah Al-Kahf tells of young believers who took refuge in a cave. Each passage is quoted, and the page marks what the verses leave unspecified: their names, the city, the number and the duration.

By Haroon AliSources checked 27 October 2026

We explain and attribute; we do not issue fatwas.

The short answer

Ashab e Kahf, the People of the Cave, are young believers whose account appears in Surah Al-Kahf 18:9 to 26. They fled to a cave, stayed there for a number of years and were then awakened. The passage names neither the sleepers nor the city, and it links their discovery to Allah's promise and the Hour.

Who were the People of the Cave?

Al-Kahf says that "they were young men who believed in their Lord" (18:13). When they fled to the cave, they asked Allah for "Give us mercy from Your presence, and shape for us right conduct in our plight" (18:10). They also reject the gods their people have chosen: "We cry to no god beside Him" (18:14 to 15).

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

Al-Kahf 18:9 to 16Or do you think that the People of the Cave and the Inscription are a wonder among Our portents? When the young men fled for refuge to the Cave and said: Our Lord! Give us mercy from Your presence, and shape for us right conduct in our plight. Then We sealed up their hearing in the Cave for a number of years. And afterward We raised them up that We might know which of the two parties would best calculate the time that they had tarried. We narrate to you their story with truth. Indeed, they were young men who believed in their Lord, and We increased them in guidance. And We made firm their hearts when they stood forth and said: Our Lord is the Lord of the heavens and the earth. We cry to no god beside Him, for then we would utter an enormity. These, our people, have chosen (other) gods beside Him though they bring no clear warrant (granted) to them. And who does greater wrong than he who invents a lie concerning Allah? And when you withdraw from them and that which they worship except Allah, then seek refuge in the Cave; your Lord will spread for you of His mercy and will prepare for you a pillow in your plight.

The passage gives no personal names and does not name their city. Its opening question calls them "the People of the Cave and the Inscription" (18:9). 1

What happens in the account?

This sequence is our reading aid. Read the verses alongside it rather than treating the headings as divisions in the Quran.

  1. The young believers seek refuge. They ask Allah for mercy and right conduct, and they refuse the gods of their people (18:10 to 15). 1
  2. They remain in the cave. The sun moves away from their cave on the right and passes them on the left, and their dog lies at the entrance (18:17 to 18). 2
  3. They awake and discuss the time. Some say they stayed a day or part of a day, and others say their Lord knows best how long they stayed. One of them is sent to the city with their silver coin, to find the purest food and bring some back (18:19). 3
  4. Their discovery becomes a sign. The people of the city come to know of them, and the passage ties this to the truth of Allah's promise and to the Hour (18:21). 4

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

Al-Kahf 18:17 to 18And you might have seen the sun when it rose move away from their cave to the right, and when it set go past them on the left, and they were in the cleft thereof. That was (one) of the portents of Allah. He whom Allah guides, he indeed is led aright, and he whom He sends astray, for him you will not find a guiding friend. And you would have thought them awake though they were asleep, and We caused them to turn over to the right and the left, and their dog stretching out his paws on the threshold. If you had observed them closely you had assuredly turned away from them in flight, and had been filled with awe of them.

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

Al-Kahf 18:19 to 20And in like manner We awakened them that they might question one another. A speaker from among them said: How long have you tarried? They said: We have tarried a day or some part of a day, (Others) said: Your Lord best knows how long you have tarried. Now send one of you with this your silver coin to the city, and let him see what food is purest there and bring you a supply thereof. Let him be courteous and let no man know of you. For they, if they should come to know of you, will stone you or turn you back to their religion; then you will never prosper.

Their fear of being found is explicit. If the people of the city came to know of them, they "will stone you or turn you back to their religion" (18:20). Their decision to seek food discreetly belongs to that situation. 3

Were there seven sleepers?

Verse 22 gives three suggestions, each with the dog counted: three with their dog the fourth, five with their dog the sixth, and seven with their dog the eighth. The verse describes these as "guessing at random". 4

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

Al-Kahf 18:21 to 22And in like manner We disclosed them (to the people of the city) that they might know that the promise of Allah is true, and that, as for the Hour, there is no doubt concerning it. When (the people of the city) disputed of their case among themselves, they said: Build over them a building; their Lord knows best concerning them. Those who won their point said: We truly shall build a place of worship over them. (Some) will say: They were three, their dog the fourth, and (some) say: Five, their dog the sixth, guessing at random; and (some) say: Seven, and their dog the eighth. Say (O Muhammad): My Lord is Best Aware of their number. None knows them except a few. So contend not concerning them except with an outward contending, and ask not any of them to pronounce concerning them.

The verse then tells the Prophet Muhammad, peace be upon him, to say: "My Lord is Best Aware of their number". It also sets a limit on argument: "So contend not concerning them except with an outward contending" (18:22).

The familiar label "seven sleepers" is not in the passage, and the passage does not confirm it. A confident number, or a list of names, would need its own identified source and explanation. 4

How long did they remain in the cave?

Verse 25 gives the length of their stay: "three hundred years and add nine". Verse 26 then says that "Allah is Best Aware how long they tarried". Both verses belong beside the figure. 5

وَلَا تَقُولَنَّ لِشَا۟ىْءٍ إِنِّى فَاعِلٌ ذَٰلِكَ غَدًا ۝ إِلَّآ أَن يَشَآءَ ٱللَّهُ ۚ وَٱذْكُر رَّبَّكَ إِذَا نَسِيتَ وَقُلْ عَسَىٰٓ أَن يَهْدِيَنِ رَبِّى لِأَقْرَبَ مِنْ هَـٰذَا رَشَدًا ۝ وَلَبِثُوا۟ فِى كَهْفِهِمْ ثَلَـٰثَ مِا۟ئَةٍ سِنِينَ وَٱزْدَادُوا۟ تِسْعًا ۝ قُلِ ٱللَّهُ أَعْلَمُ بِمَا لَبِثُوا۟ ۖ لَهُۥ غَيْبُ ٱلسَّمَـٰوَٰتِ وَٱلْأَرْضِ ۖ أَبْصِرْ بِهِۦ وَأَسْمِعْ ۚ مَا لَهُم مِّن دُونِهِۦ مِن وَلِىٍّ وَلَا يُشْرِكُ فِى حُكْمِهِۦٓ أَحَدًا

Al-Kahf 18:23 to 26And say not of anything: Indeed, I shall do that tomorrow, Except if Allah wills. And remember your Lord when you forget, and say: It may be that my Lord guides me to a nearer way of truth than this. And (it is said) they tarried in their Cave three hundred years and add nine. Say: Allah is Best Aware how long they tarried. His is the Invisible of the heavens and the earth. How clear of sight is He and keen of hearing! They have no protecting friend beside Him, and He makes none to share in His government.

The passage does not explain the figure, and this page does not add an explanation of its own. Any explanation would need an attributed commentary. In the English, the bracketed words stand before the figure. Those are the translator's words: the Arabic of verse 25 does not contain them.

Where was the cave, and what were their names?

The account in 18:9 to 26 does not name the city, place the cave in a modern country or give the sleepers' personal names. It mentions "the city" when one of them is sent for food (18:19) and it mentions their dog (18:18), but it names neither.

A place advertised as the "cave of the seven sleepers", or linked with Ephesus, is a separate historical claim. This Quran-based account does not confirm any site or settle the history of the Ephesus tradition.

What does the account emphasise?

Faith and the request for guidance come near the start (18:10 and 18:13). Verse 21 ties the discovery to Allah's promise and the Hour, and verse 22 limits speculation about the number. These are points in the text itself, not extra dialogue or an imagined backstory.

Verses 23 and 24 speak of future intentions with reference to Allah's will: "Except if Allah wills" (18:24). For the separate phrase lesson, read Inshallah. 5

Verse 21 reports that some people proposed a place of worship over them: "We truly shall build a place of worship over them". Reporting what those people said is not a ruling on buildings or graves. A personal question about that subject belongs with a scholar you trust. 4

I first heard about the People of the Cave in a Friday khutbah, and the part that stuck with me was the dog lying at the entrance. In the car home my little brother wanted to know the dog's name. Neither of us knew, and we argued about it all the way back.

Haroon Alistudent of knowledge

Try it: three questions

Pick an answer; each one explains itself.

  1. 1What do the young believers ask for at the start?

    Answer: Mercy and right conduct in their situation. Verse 10 asks for mercy from the Lord's presence and for right conduct in their plight.

  2. 2Why is one of them sent to the city?

    Answer: To buy food with their silver coin, without drawing attention. Verse 19 tells them to send one of them with their silver coin to find the purest food, and to let no one know of them.

  3. 3Does the passage name their dog?

    Answer: No, it describes the dog but gives it no name. Verse 18 describes the dog stretching out its paws at the threshold. Verses 9 to 26 give it no name.

Questions people ask

Are the names of the People of the Cave given in the Quran?

No. The passage in Al-Kahf 18:9 to 26 gives their faith, their words and their actions, but no personal names, so this page does not supply any.

Is the cave of the seven sleepers in Ephesus?

The passage names neither Ephesus nor any other city. The Ephesus tradition is a separate historical claim, and this page does not confirm it or any site.

How many sleepers were there?

Verse 22 reports three, five and seven as suggestions, each with the dog counted, and says that My Lord is best aware of their number. This page does not choose a number.

Sources

Every claim on this page comes from one of these. The Arabic is Tanzil's Uthmani text (CC BY 3.0). English: adapted from Marmaduke Pickthall's translation (1930), modernised and checked against modern translations.

  1. 1

    The young believers seek refuge, ask for mercy and guidance, and refuse to cry to other gods.

    Quran, Al-Kahf 18:9 to 16

  2. 2

    The cave scene describes the sun moving past the cave, their turning and their dog at the entrance.

    Quran, Al-Kahf 18:17 to 18

  3. 3

    They discuss how long they stayed, and one is sent to the city with their silver coin to buy food discreetly. The verse warns that the people of the city would stone them or turn them back to their religion if they found out.

    Quran, Al-Kahf 18:19 to 20

  4. 4

    Their discovery is linked with the truth of Allah's promise and the Hour. The three suggested numbers are reported, with the limit on disputing about them, and a proposal to build a place of worship over them is reported.

    Quran, Al-Kahf 18:21 to 22

  5. 5

    Future intentions are tied to Allah's will (18:23 to 24). Verse 25 gives the figure, and verse 26 refers the length of their stay to Allah's knowledge.

    Quran, Al-Kahf 18:23 to 26

Next

For your own situation, ask a scholar you trust.

Join the email list

New guides by email, now and then. No spam, and you can leave at any time.

We keep only your email address. Privacy.

Ilmwell is free and kept going by readers. See how to support it.