Quran & Hadith

Three Men in a Cave: Hadith on Sincerity (Ikhlas)

A True Story of Sincerity from the Hadith

The Core Lesson

This authentic hadith tells the story of three men trapped in a cave by a boulder. They are saved only by calling upon Allah and mentioning their most sincere, hidden good deeds. The story teaches three profound lessons:

  • Sincerity (Ikhlas): Good deeds done purely for Allah are powerful.
  • Tawassul through Deeds: You can ask Allah for help by mentioning your sincere actions.
  • Leaving Sin: Restraining oneself from sin when having the full ability to commit it is a great act of worship.
Share this answer:WhatsAppTwitterFacebook

Test your knowledge of Hadith stories

Learn & play

Play Deen Trivia to reinforce lessons of Ikhlas, Sadaqah, and Prophetic ethics.

Play Deen Trivia

This is an authentic story from the time before the Prophet Muhammad (ﷺ), told by the Prophet himself to his companions. It is recorded in both Sahih al-Bukhari (2272) and Sahih Muslim (2743). It beautifully illustrates the power of Ikhlas (sincerity) and good deeds.


The Story (قصہ)

English:
Three men from the people before you were traveling when they were overtaken by a storm. They took refuge in a cave in a mountain. Suddenly, a massive rock rolled down the mountain and completely blocked the entrance of the cave. They were trapped. They realized that no one could hear them and they would surely perish unless Allah saved them. They said to one another: "Nothing will save you from this rock except that you invoke Allah by your righteous deeds."

اردو:
پچھلی امتوں میں سے تین آدمی سفر کر رہے تھے کہ اچانک طوفان آ گیا۔ انہوں نے پہاڑ کی ایک غار میں پناہ لی۔ اچانک ایک بہت بڑی چٹان پہاڑ سے لڑھک کر آئی اور غار کے منہ پر گر کر اسے مکمل طور پر بند کر دیا۔ وہ پھنس گئے۔ انہیں احساس ہوا کہ کوئی ان کی آواز نہیں سن سکتا اور وہ یقیناً ہلاک ہو جائیں گے جب تک کہ اللہ انہیں نہ بچائے۔ انہوں نے ایک دوسرے سے کہا: "اس چٹان سے تمہیں کوئی چیز نہیں بچا سکتی سوائے اس کے کہ تم اللہ سے اپنے نیک اعمال کے واسطے سے دعا کرو۔"

The First Man: Dutifulness to Parents (والدین کی خدمت)

English:
The first man prayed: "O Allah! I had elderly parents, and I never provided my family or slaves with milk before them. One day, I went far away in search of green leaves for my sheep, and I did not return until they had slept. I milked the sheep for them and brought the milk, but found them sleeping. I disliked giving milk to my family or slaves before them, so I stood by their heads with the bowl in my hands, waiting for them to wake up until dawn broke. Then they woke up and drank their milk. O Allah! If I did that seeking Your Countenance, then relieve us from our situation!"

The rock moved a little, but they still could not get out.

اردو:
پہلے آدمی نے دعا کی: "اے اللہ! میرے بوڑھے والدین تھے، اور میں اپنے خاندان یا غلاموں کو ان سے پہلے دودھ نہیں پلاتا تھا۔ ایک دن، میں اپنی بکریوں کے لیے چارہ تلاش کرنے دور نکل گیا اور اس وقت تک واپس نہ آیا جب تک وہ سو نہ گئے۔ میں نے ان کے لیے دودھ دوہا اور لے کر آیا، لیکن انہیں سوتا ہوا پایا۔ مجھے یہ پسند نہ آیا کہ میں ان سے پہلے اپنے خاندان یا غلاموں کو دودھ دوں، چنانچہ میں پیالہ ہاتھ میں لیے ان کے سرہانے کھڑا رہا اور ان کے جاگنے کا انتظار کرتا رہا یہاں تک کہ صبح ہو گئی۔ پھر وہ جاگے اور اپنا دودھ پیا۔ اے اللہ! اگر میں نے یہ کام صرف تیری رضا حاصل کرنے کے لیے کیا تھا، تو ہمیں اس مصیبت سے نجات دے!"

چٹان تھوڑی سی کھسک گئی، لیکن وہ ابھی بھی باہر نہیں نکل سکتے تھے۔

Quranic Connection:

۞ وَقَضَىٰ رَبُّكَ أَلَّا تَعْبُدُوٓا۟ إِلَّآ إِيَّاهُ وَبِٱلْوَٰلِدَيْنِ إِحْسَـٰنًا ۚ

"اور تمہارے رب نے فیصلہ کر دیا ہے کہ تم اس کے سوا کسی کی عبادت نہ کرو اور والدین کے ساتھ حسن سلوک کرو۔"

"And your Lord has decreed that you not worship except Him, and to parents, good treatment."

— Surah Al-Isra, (17:23)


The Second Man: Fear of Allah (اللہ کا ڈر)

English:
The second man prayed: "O Allah! I had a female cousin whom I loved more than anyone else. I desired her, but she refused me. Years later, a severe famine struck, and she came to me for help. I gave her 120 dinars on the condition that she would yield herself to me. She agreed out of desperation. But when I sat between her legs, she said, 'Fear Allah, and do not break the seal unlawfully.' I immediately moved away from her, despite my immense love for her, and I left the gold with her. O Allah! If I did that seeking Your Countenance, then relieve us!"

The rock moved a bit more, but they still could not get out.

اردو:
دوسرے آدمی نے دعا کی: "اے اللہ! میری ایک چچا زاد بہن تھی جس سے میں سب سے زیادہ محبت کرتا تھا۔ میں نے اس سے برائی کا ارادہ کیا، لیکن اس نے انکار کر دیا۔ سالوں بعد، قحط پڑا اور وہ مدد کے لیے میرے پاس آئی۔ میں نے اسے 120 دینار اس شرط پر دیے کہ وہ اپنے آپ کو میرے حوالے کر دے۔ وہ مجبوری میں مان گئی۔ لیکن جب میں برائی کے ارادے سے اس کے قریب ہوا، تو اس نے کہا، 'اللہ سے ڈرو، اور اس مہر کو ناحق نہ توڑو۔' میں فوراً اس سے دور ہٹ گیا، حالانکہ مجھے اس سے شدید محبت تھی، اور میں نے وہ سونا بھی اسی کے پاس چھوڑ دیا۔ اے اللہ! اگر میں نے یہ کام صرف تیری رضا کے لیے کیا تھا، تو ہمیں اس مصیبت سے نکال!"

چٹان تھوڑی اور کھسک گئی، لیکن وہ ابھی باہر نہیں نکل سکتے تھے۔

The Third Man: Trustworthiness and Honesty (امانت اور دیانتداری)

English:
The third man prayed: "O Allah! I hired some laborers and paid them their wages, except for one man who left before taking his due. I invested his wages in agriculture/livestock, and it grew into vast wealth. After some time, he came to me and said, 'O servant of Allah, give me my wages.' I said, 'All the camels, cows, sheep, and slaves you see are your wages.' He said, 'Do not mock me!' I replied, 'I am not mocking you.' So he took everything and left nothing behind. O Allah! If I did that seeking Your Countenance, then relieve us!"

The rock moved completely, and they walked out free.

اردو:
تیسرے آدمی نے دعا کی: "اے اللہ! میں نے کچھ مزدور رکھے اور انہیں ان کی مزدوری دی، سوائے ایک آدمی کے جو اپنا حق لیے بغیر چلا گیا۔ میں نے اس کی مزدوری کو کاروبار (کھیتی باڑی/مویشیوں) میں لگا دیا، اور وہ بہت بڑی دولت بن گئی۔ کچھ عرصے بعد، وہ میرے پاس آیا اور بولا، 'اے اللہ کے بندے، مجھے میری مزدوری دے دو۔' میں نے کہا، 'یہ تمام اونٹ، گائے، بکریاں اور غلام جو تم دیکھ رہے ہو، یہ تمہاری مزدوری ہے۔' اس نے کہا، 'مجھ سے مذاق نہ کرو!' میں نے جواب دیا، 'میں تم سے مذاق نہیں کر رہا۔' چنانچہ وہ سب کچھ لے گیا اور کچھ نہ چھوڑا۔ اے اللہ! اگر میں نے یہ کام صرف تیری رضا کے لیے کیا تھا، تو ہمیں نجات دے!"

چٹان پوری طرح ہٹ گئی، اور وہ آزاد ہو کر باہر نکل آئے۔

Quranic Connection:

وَٱلَّذِينَ هُمْ لِأَمَـٰنَـٰتِهِمْ وَعَهْدِهِمْ رَٰعُونَ

"اور جو اپنی امانتوں اور اپنے عہد کا پاس رکھنے والے ہیں"

"And they who are to their trusts and their promises attentive"

— Surah Al-Mu'minun, (23:8)


Authentic Hadith Reference (حوالہ)

سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏ "‏ انْطَلَقَ ثَلاَثَةُ رَهْطٍ مِمَّنْ كَانَ قَبْلَكُمْ حَتَّى أَوَوْا الْمَبِيتَ إِلَى غَارٍ فَدَخَلُوهُ، فَانْحَدَرَتْ صَخْرَةٌ مِنَ الْجَبَلِ فَسَدَّتْ عَلَيْهِمُ الْغَارَ...

I heard Allah's Messenger (ﷺ) saying, "Three men, amongst those who came before you, set out until night came and they reached a cave, so they entered it. A rock fell down from the mountain and blocked the entrance of the cave..."


Key Lessons (اہم اسباق)

  1. Sincerity (Ikhlas - اخلاص): Good deeds must be done entirely for the sake of Allah. It was their sincerity that saved them.
    نیک اعمال خالصتاً اللہ کی رضا کے لیے ہونے چاہئیں۔ ان کے اخلاص نے ہی انہیں بچایا۔
  2. Righteous Deeds as Intercession (Tawassul - نیک اعمال کا وسیلہ): It is permissible and highly effective to ask Allah for help by mentioning a sincere good deed you have done.
    اپنی کسی سچی نیکی کا واسطہ دے کر اللہ سے مدد مانگنا جائز اور انتہائی موثر ہے۔
  3. Leaving Sin for Allah (اللہ کے خوف سے گناہ چھوڑنا): Restraining oneself from sin when having the full ability to commit it is one of the greatest acts of worship.
    گناہ کرنے کی مکمل طاقت ہونے کے باوجود اللہ کے ڈر سے رک جانا سب سے بڑی عبادتوں میں سے ایک ہے۔

Frequently asked questions

Sincerity in giving: calculate Zakat

Pair Ikhlas with obligation—if your wealth meets Nisab, purify it with 2.5% Zakat.

Calculate Zakat

Related guides

Reviewed by Islamic Finance Experts

Based on authentic Hanafi Fiqh rulings

Last reviewed: October 2026View full methodology