إِذْ أَوَى ٱلْفِتْيَةُ إِلَى ٱلْكَهْفِ فَقَالُوا۟ رَبَّنَآ ءَاتِنَا مِن لَّدُنكَ رَحْمَةً وَهَيِّئْ لَنَا مِنْ أَمْرِنَا رَشَدًا ﴿10﴾ فَضَرَبْنَا عَلَىٰٓ ءَاذَانِهِمْ فِى ٱلْكَهْفِ سِنِينَ عَدَدًا ﴿11﴾
10 When the young men fled for refuge to the Cave and said: Our Lord! Give us mercy from Thy presence, and shape for us right conduct in our plight. 11 Then We sealed up their hearing in the Cave for a number of years.
Al-Kahf 18:10–11 on Quran.com · Pickthall’s translation
The young men of the cave lived under a ruler who banned belief in Allah and forced his own disbelief on his people. The Quran calls them fityah, young men, very likely teenagers. They decided they would not live like that. So they left their homes and their families and went to live hidden in a cave in the hills, if that was the price of keeping their faith. It is a huge sacrifice: choosing Allah over everything and everyone. Early Muslims made the same choice when a group of them, among them the Prophet’s ﷺ own daughter, left Makkah as refugees for Abyssinia.
Notice that Allah points out that they were young. Many of us connect devotion with old age, as if worship is for when life gets less busy. But there is something special about turning to Allah while you are young, when temptations are strong and life pulls you in every direction. Among the seven people shaded by Allah on the Day when there is no shade but His is a young person who grew up worshipping Allah (Sahih al-Bukhari 660). One elderly woman, finishing Hajj among many young pilgrims, cried because she kept asking herself: what kind of Muslim could I have become if I had done this earlier?
When they reached the cave they did not know what came next. So they made dua: Our Lord, give us mercy from Yourself, and set right for us our affair (al-Kahf 18:10). The first thing they asked for was rahmah, mercy. Mercy can sound vague. One scholar defined it simply: mercy is Allah giving you what you need, when you need it. That is why mercy comes in different shapes. For one person it is a door opening. For another it is a door closing. Two people can ask for the same job. One gets it and one does not, and both have been given mercy.
The second thing they asked for was rashad, right direction. Give us a way through this, and let it turn out well. The Prophet ﷺ asked Allah for this often, because no one faced more obstacles than he did. And they asked for mercy knowing how wide it is. The Prophet ﷺ told us that Allah wrote: My mercy prevails over My anger (Sahih al-Bukhari 3194). Whatever you are facing, His mercy is bigger. In the cave, they surrendered themselves to it.
Allah’s answer was not what anyone would have planned. Then We sealed their hearing in the cave for a number of years (al-Kahf 18:11). They slept. If an angel had told them in advance, they might have asked: how will we eat, what about the dog, how long? That is why, when you make dua, you should not try to solve the dua yourself. Make it, and let Allah take care of it. The Prophet ﷺ said to tie your camel and trust Allah (Jami at-Tirmidhi 2517, graded hasan by Darussalam). He did not say strangle the camel, or buy three spares just in case.
There is a pattern in how Allah deals with people. When someone cuts themselves off from whatever would harm their faith, when they leave, flee and take refuge for His sake, Allah replaces what they left with something better. These young men left as a small, hunted group. They woke up in a whole community that believed as they did. Whoever has Allah has everything, and whoever does not is always in need. One community in America prayed Jumuah for more than a decade in a small rented room at a recreation centre, booked week by week. They ran to their cave too, and now they sit in the front rows of a full masjid.
So the cave dua is worth keeping for any moment when you have given something up for Allah and do not know the next step. Ask for mercy, ask for direction, and leave the shape of the answer to Him. You will find it with other duas from the Quran on our Quranic duas page, and the whole story on the Surah al-Kahf map.