Lessons from the People of the Cave - Dr Ahsan Hanif

By Dr. Ahsan Hanif | 2026-07-06T18:40:18.612108+00:00 | Topic: Quran

Khutbah: Lessons from the People of the Cave

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

أَمَّا بَعْدُ: فَإِنَّ أَصْدَقَ الْحَدِيثِ كِتَابُ اللَّهِ تَعَالَى وَخَيْرَ الْهُدَى هُدَى مُحَمَّدٍ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَشَرَّ الْأُمُورِ مُحْدَثَاتُهَا وَكُلَّ مُحْدَثَةٍ بِدْعَةٌ وَكُلَّ بِدْعَةٍ ضَلَالَةٌ وَكُلَّ ضَلَالَةٍ فِي النَّارِ

Introduction: Surah Al-Kahf and Its Trials

From the Sunnahs of this blessed day of Friday is to recite Surah Al-Kahf. The recitation of Surah Al-Kahf is because the surah deals with many of the trials that we will face in our lives — the trials of believing in Islam and standing up for your faith, the trials of wealth, the trials of power, the trials of knowledge, and so on and so forth.

It is the first of those stories that Allah mentions within Surah Al-Kahf — after whom the surah is named — those People of the Cave, that I want to discuss in today's khutbah. Today's khutbah is addressed to the younger members of our community, our younger brothers and sisters. But even though it is addressed to them, as is the beauty and the eloquence of the Qur'an, there are still lessons for all of us to extrapolate from these stories of the Qur'an.

The Setting: A Society Upon Shirk

Allah mentions the story of the People of the Cave — a group of young men. Ibn Kathir rahimahullah mentions in his tafsir that these young men lived in a time when the vast majority of people were worshipping other than Allah. They were upon shirk and disbelief. They had idols that they would worship, and they would prostrate to them, sacrifice to them, and make du'a to these idols besides Allah.

The leader of that community at that time was known to be a tyrant king — an oppressor. He did not accept anyone changing his religion, did not accept anyone differing with him, especially when it came to the beliefs that he held and the religion that he was upon.

Ibn Kathir rahimahullah mentions that this group of young men — seven in number as is mentioned in the Qur'an — did not know one another. They were individuals from different parts of that city, from different families. They weren't friends, they weren't brothers, they weren't relatives, they weren't colleagues. They were just seven individual young men. Those young men, even though they lived at a time when the people were upon shirk, they were upon their fitrah, and they understood and realized that the shirk their people were upon was wrong, and that worshipping other than Allah was not what Allah wanted from them. And so they came to the realization of tawheed — that Allah alone is deserving of all worship.

Ibn Kathir rahimahullah mentions in a narration that those seven young men were sitting together — all of those other people around them upon shirk. Imagine living in a society where the vast majority of people are not only upon shirk but are also enemies to those who oppose that way of life. We, by the grace of Allah, in this city number in the tens of thousands. In this masjid alone there are a few thousand of us. Imagine if there were only seven of you — seven of you living in a city or a community — and not only that, but those people around you are enemies to you, and they will persecute and torture you for your beliefs.

So those seven young men sat under that tree and one of them spoke. He said: "We all know that we're sitting here for one reason. We've all sat here for the same reason, but none of us is brave enough to speak and mention this reason." So after some time one of them built up his courage and said: "I came here because I don't believe in the shirk that my people are upon. I believe that we should worship Allah and Allah alone." And then the other six concurred and agreed.

So those seven people agreed that they would worship Allah alone, together. This is when they became a unit — a community amongst themselves. They agreed that they would worship Allah, but they would do so on the outskirts of their town, so that the people would not see them, because if they saw them and knew what they were up to, they would persecute them for their beliefs. So they would go every so often to the outskirts of their town and worship Allah.

Brought Before the Tyrant King

But Allah did not want these seven young men simply to worship Allah and to die in that way. Allah wanted to make their lives a lesson for us today. He wanted us to know about it through the Qur'an. So Allah decreed that after some time, a group of people would walk past them as they were worshipping, and they would see what these people were upon. It was alien and foreign to them — worshipping in a way unlike the gods and idols they were accustomed to. This was some new form of religion. So they took this straight to that tyrant king and told him: "This group of young men have changed your religion. They've come with a new religion, a new act of worship. They claim that all of these gods that you worship are false gods, and that you should worship Allah alone."

So the king — known for his tyranny, oppression, and injustice — called these seven young men together. This is where Allah begins the story in Surah Al-Kahf. All of this before is just information so that you can arrive at this point within the Qur'an. Why? Because Allah mentions here the stance that they took.

Lesson One: Steadfastness in the Face of Trials

The first lesson that we take from the story of the People of the Cave is that as Muslims we are tried within our religion. We face challenges and obstacles. Especially our younger brothers and sisters — going through school, going through college, going through university — they have challenges they face sometimes on a daily basis. When those challenges come to them, they have a choice: either they can be proud of their religion, remain steadfast, and have honour in the beliefs they hold, knowing that their religion is the religion that Allah chose for them — or they can shy away.

Just as these young men also had that choice. They could have gone to that king, stood in front of him, and said: "You are mistaken, or what these people thought they saw was a mistake. We are upon your gods, we still believe in that," — out of fear of persecution, not because they really believed so. Or they could be firm, stand up, and call those people to Allah.

And Allah makes a point in Surah Al-Kahf of mentioning that these young men were young. These were a group of young men. They weren't old. They weren't people who had decades upon decades of experience. They were young men — men who at that time, normally in their age, would be busy with the dunya, busy enjoying life, with so many different hopes and ambitions and dreams. But Allah mentions that they were a group of young men, and when they believed in Allah, Allah increased them in guidance.

And that is the first method of salvation: that when you have strong belief in Allah, and your iman in Allah is strong, and your reliance and trust upon Allah is strong, and your certainty in the promise of Allah is strong — then Allah comes to your aid, He makes your affairs easy for you, and the challenges that you face, Allah helps you to overcome them.

They believed in their Lord, so He increased them in guidance. So they stood in front of that tyrant king — with the choice to either shy away or remain steadfast — and they chose to remain steadfast, in the face of his known tyranny and oppression, in the face of his army and the wealth at his command, in the face of all of those people in their community, their family, their friends, their neighbours, the people that they grew up with. All of those people were upon that shirk and they disliked anyone who came with something different. But they remained firm.

Allah says that He caused their hearts to remain firm when they stood in front of their king and those people, and they said:

وَرَبَطْنَا عَلَىٰ قُلُوبِهِمْ إِذْ قَامُوا۟ فَقَالُوا۟ رَبُّنَا رَبُّ ٱلسَّمَٰوَٰتِ وَٱلْأَرْضِ لَن نَّدْعُوَا۟ مِن دُونِهِۦٓ إِلَٰهًۭا ۖ لَّقَدْ قُلْنَآ إِذًۭا شَطَطًا

"Our Lord is the Lord of the heavens and the earth. We will never call upon a god besides Him, for if we do so, then indeed it is a grave form of speech."

They had that strength of iman to stand in front of those people, knowing that Allah was with them. And if Allah is with someone, helping someone, aiding someone — then it doesn't matter what those people worship besides Allah. Those idols can't speak, can't talk, can't eat, can't drink, can't defend themselves. What types of gods are these? Why don't you bring us some clear proof? And who is more oppressive than the one who ascribes lies to Allah?

So the king was so overcome by the power of their speech and the evidences they were using that he was succumbed, and he allowed them to leave his court and his palace. But when this group of young men left, they came to the realization that it was only a matter of time before he asked them to return, before he persecuted them, tortured them, and perhaps even killed them. So they decided they would leave their town, boycott their community, and go seek shelter in a cave — so that things would calm down, the issue would cool down, and they would be able to take their next steps. And so they went with this intention.

وَإِذِ ٱعْتَزَلْتُمُوهُمْ وَمَا يَعْبُدُونَ إِلَّا ٱللَّهَ فَأْوُۥٓا۟ إِلَى ٱلْكَهْفِ يَنشُرْ لَكُمْ رَبُّكُم مِّن رَّحْمَتِهِۦ وَيُهَيِّئْ لَكُم مِّنْ أَمْرِكُم مِّرْفَقًۭا

"When you leave them and that which they worship besides Allah, then head towards the cave. Seek shelter in the cave. Your Lord will place mercy before you and He will make your affair gentle for you."

Lesson Two: Hope in the Mercy of Allah

These people, as they entered into the cave, their hope was in the mercy of Allah, their hope was in the gentleness and kindness of their Lord and Creator. And this gives us a sense of optimism — that even in the most difficult of times, these young men are running, not just because they're going on holiday, not because they have nothing better to do. They're running out of fear for their lives, out of fear of persecution and torture. Yet even so, as they enter into that cave, they're not paralysed by fear of the oppression of their people or the tyranny that may approach them. Rather, they are hopeful in the mercy of Allah.

That sense of optimism — which we find also throughout the stories of the prophets of Allah — that even in the most difficult of circumstances, they still had that hope in the mercy of Allah, despite the odds being stacked against them. They still had the hope that Allah would come to their aid. And Allah does not dismiss the hopes of the believers.

This group of young men entered the cave with the intention of seeking shelter for a short period of time, and they entered with the hope that Allah would make their affairs easy for them. So Allah responded in a way that was beyond their imagination — in a way that would become a miracle not only for them and the people of that time, but would serve as a miracle of Allah throughout the ages. Until today we still read about the story of these young men.

These young men weren't prophets of Allah, they weren't messengers of Allah, they didn't receive revelation, no angels came to them with an army. These were a group of young men — simply by the strength of their iman and their taqwaAllah gave them an amazing miracle.

The Miracle: Three Centuries of Sleep

So what is that miracle? They came into this cave and Allah decreed that they would sleep for over three centuries — for 300 years they would lay asleep. But Allah doesn't just tell us that they slept for 300 years. He tells us how the universe came to their aid, how Allah caused the sun and other things from amongst the universe to come to the aid of these young men. Why? Because when Allah wants to help His believing slaves, Allah doesn't need to send an army. He doesn't need to do anything. He simply issues a command: كُن فَيَكُونُ — "Be, and it is." And everything in the heavens and the earth is a slave to Allah, it is from the creation of Allah.

Allah says that as those young men lay within that cave and fell asleep — thinking they were only going to rest for a short while — Allah decreed that they would sleep for 300 years. But in that time much would change. So Allah preserved their bodies, preserved them in such a way that after three centuries, when they woke up, they felt as if they had only just gone to sleep.

Imagine: you go to sleep last night and you wake up. If you wake up maybe two or three hours later than your normal time, you feel groggy. You know that you've overslept. You understand that something is wrong. Your body doesn't feel the way it normally does. These people slept for over 300 years, but Allah preserved them in such a way that when they woke up they felt they had just gone to sleep.

So Allah used the sun so that sunlight would strike their bodies. And today we know from modern science and medicine that we need sunlight as humans in order for our bodies to continue to function. The sunlight would come within the cave and touch their bodies.

Allah says: "You would think that they were awake even though they were asleep." Some of the scholars of tafsir say that the meaning of this is that they would sleep with their eyes open, or with one eye open, alternating between their eyes. This is a defense mechanism in the animal kingdom — animals sleep with one eye open and one eye closed as a means of warning against predators. But today we also know that our eyes need to blink in order for the moisture of our eyes to continue.

Allah also mentions: "We cause them in their sleep to turn from right and left" — because if you are asleep for a long time, your body needs to move in order for blood to continue to circulate, so that gravity doesn't pull the blood down, so that when you wake up you can continue to use your body. And that is why you often go to sleep in one position and wake up in another.

All of these signs that Allah gave them, so that He would preserve their sleep. And Allah says:

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

"Whosoever Allah decrees is guided then he is truly guided. And as for the one that Allah misguides, then you will never find for them a guide nor a helper."

Allah preserved their sleep for 300 years. Not only that, but Allah also mentions that along with them there was a dog that accompanied them at the mouth of the cave — a dog that also slept for 300 years. Some of the scholars of tafsir say that as these young men were leaving from the court of the king and travelling towards the cave, they came across a farm and there was a dog on that farm, and it simply followed them.

The Wisdom Behind the Qur'anic Narrative

In the story in Surah Al-Kahf, Allah mentions that these people slept for over three centuries and in two verses He speaks about the way He preserved them and the way the universe — the creation of Allah — came to their aid, and then Allah mentions that they were resurrected, that they awoke after three centuries.

Often within the stories of the Qur'an we find that Allah in certain places goes into explicit detail, but in other places He skips large portions of the story. The reason for this is because Allah only mentions what is important in the Qur'an, only mentions what is relevant, what we can derive benefit from. The stories of the Qur'an are not just there to give us information. They're not just something you're meant to read for enjoyment. It is more precious than this. The Qur'an is so that you can take from its wisdoms and its lessons.

The Awakening After Three Centuries

And so they woke up after three centuries:

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

"And thus We caused them to awake after three centuries so that they may question one another."

When they woke up, their hair wasn't long as it would normally be after three centuries. Their nails hadn't grown to the length of three centuries. When they woke up and saw one another, they had a question:

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

One from amongst them said: "How long have we slept?" — knowing that something was slightly off, not really understanding how long they had slept.

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

In response they said: "We have slept for a day or part of a day." Three hundred years of sleep, and they think they've just woken up as if they slept for a day or part of a day!

Part of the preservation of that sleep is not just that their body, their hair, and their nails were preserved — but also that when they woke up, they would wake up with the same feeling of terror and fear with which they went to sleep. Three centuries have passed, the climate has changed, the geography has changed, the terrain has changed. Those people they went to sleep knowing have died, their children have come and died, the next generation has probably come and died too. But those seven young men, when they wake up, still have that same feeling of terror, that same feeling of fear.

So they say:

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

"Your Lord Allah has more knowledge as to how long you slept. We have more important issues to worry about. We need food" — because they think they've slept for a day, they wake up with that same feeling of hunger — "so let one of you take this money and go back to the city and let him look for the purest of food, and let him bring some of it back to us. And let him be gentle, be quiet, be secretive, and let no one know what you're up to. Because if those people learn where you are, they will stone you to death or make you apostate from your religion."

إِنَّهُمْ إِن يَظْهَرُوا۟ عَلَيْكُمْ يَرْجُمُوكُمْ أَوْ يُعِيدُوكُمْ فِى مِلَّتِهِمْ وَلَن تُفْلِحُوٓا۟ إِذًا أَبَدًۭا

"And then you will never be successful."

Notice, even in this time of fear, even in this time of necessity, even in this time of terror — when they feel that they are going to be killed and persecuted — they don't just say: "Grab the first thing that you find and bring it back." Rather: "Bring back the purest of food." Some of the scholars said: the most halal of food. Why? Because those people around them were upon shirk, their food was sacrificed to other than Allah, to their idols and gods. They didn't just want any food. They were people of excellence, people who had a strong connection to Allah, and so they wanted the purest of food.

The Discovery and Its Divine Purpose

Going back in that same state of fear, one of them leaves the group of seven and goes back to the town. Ibn Kathir says that when he bought some food and gave the money to the store owner, the store owner saw this money and it was a different type of currency — three centuries later — than what the people were using. So he wasn't accustomed to this currency, and he took it to the next person in their market, and that person also didn't recognize the currency. And so they went to the third person, and like this, slowly but surely the people came to know that this young man was from a different time, a different place — not someone they were familiar with.

And so he was forced to tell those people his story. Thinking he was caught, he took them back to the group. And so the seven were discovered — after three centuries of sleep.

Allah mentions that they were discovered so that the people would know that the promise of Allah is true. So that the people should know that the promise of Allah is true: the promise that He helps and aids His believers, the promise that He makes gentle the affairs of those who have iman in Him, the promise that Allah showers His mercy upon the people of taqwa, the promise that Allah will give victory to the believers.

So Allah wanted the people to know that His promise was true — and that there is no doubt in the Day of Judgement. Just as Allah was able to put these people to sleep for over three centuries and then awaken them with the utmost ease, likewise Allah will resurrect all of the people — from Adam until the very last person that lives — and we will all stand in front of Allah for the accounting.

Conclusion: A Story for Every Generation

The story, my dear brothers and sisters in Islam, is one of the stories that we are supposed to recite on a weekly basis. But it's not just a story that you read in the Qur'an and pass over. It is a story that has many, many lessons that we can derive from it. I have only scratched the surface.

And so the message from the khutbah today — especially for our younger brothers and sisters — is to go back today to the story of the People of the Cave in Surah Al-Kahf, to read the translation of its meanings, to try to derive its lessons, and to understand what Allah wants us to take benefit from in this story.

Ask Allah that He makes us strong in iman — that Allah makes not only us strong in iman, but our families and our children and the younger members of our community. That Allah showers His mercy upon us and makes our affairs easy and gentle for us. Ask Allah that He safeguards us from the traps of Shaytan, that He protects us and our families and our community from harm, that Allah showers us with His blessings, that Allah forgives us for our sins, and enters us into Jannah.