حَدَّثَنَا إِبْرَاهِيمُ بْنُ الْمُنْذِرِ، حَدَّثَنَا أَبُو ضَمْرَةَ، حَدَّثَنَا مُوسَى بْنُ عُقْبَةَ، عَنْ نَافِعٍ، عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ ـ رضى الله عنهما ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ بَيْنَمَا ثَلاَثَةُ نَفَرٍ يَمْشُونَ أَخَذَهُمُ الْمَطَرُ، فَأَوَوْا إِلَى غَارٍ فِي جَبَلٍ، فَانْحَطَّتْ عَلَى فَمِ غَارِهِمْ صَخْرَةٌ مِنَ الْجَبَلِ فَانْطَبَقَتْ عَلَيْهِمْ، فَقَالَ بَعْضُهُمْ لِبَعْضٍ انْظُرُوا أَعْمَالاً عَمِلْتُمُوهَا صَالِحَةً لِلَّهِ فَادْعُوا اللَّهَ بِهَا لَعَلَّهُ يُفَرِّجُهَا عَنْكُمْ‏.‏ قَالَ أَحَدُهُمُ اللَّهُمَّ إِنَّهُ كَانَ لِي وَالِدَانِ شَيْخَانِ كَبِيرَانِ، وَلِي صِبْيَةٌ صِغَارٌ كُنْتُ أَرْعَى عَلَيْهِمْ، فَإِذَا رُحْتُ عَلَيْهِمْ حَلَبْتُ، فَبَدَأْتُ بِوَالِدَىَّ أَسْقِيهِمَا قَبْلَ بَنِيَّ، وَإِنِّي اسْتَأْخَرْتُ ذَاتَ يَوْمٍ فَلَمْ آتِ حَتَّى أَمْسَيْتُ، فَوَجَدْتُهُمَا نَامَا، فَحَلَبْتُ كَمَا كُنْتُ أَحْلُبُ، فَقُمْتُ عِنْدَ رُءُوسِهِمَا، أَكْرَهُ أَنْ أُوقِظَهُمَا، وَأَكْرَهُ أَنْ أَسْقِيَ الصِّبْيَةَ، وَالصِّبْيَةُ يَتَضَاغَوْنَ عِنْدَ قَدَمَىَّ، حَتَّى طَلَعَ الْفَجْرُ، فَإِنْ كُنْتَ تَعْلَمُ أَنِّي فَعَلْتُهُ ابْتِغَاءَ وَجْهِكَ فَافْرُجْ لَنَا فَرْجَةً نَرَى مِنْهَا السَّمَاءَ‏.‏ فَفَرَجَ اللَّهُ فَرَأَوُا السَّمَاءَ‏.‏ وَقَالَ الآخَرُ اللَّهُمَّ إِنَّهَا كَانَتْ لِي بِنْتُ عَمٍّ أَحْبَبْتُهَا كَأَشَدِّ مَا يُحِبُّ الرِّجَالُ النِّسَاءَ، فَطَلَبْتُ مِنْهَا فَأَبَتْ حَتَّى أَتَيْتُهَا بِمِائَةِ دِينَارٍ، فَبَغَيْتُ حَتَّى جَمَعْتُهَا، فَلَمَّا وَقَعْتُ بَيْنَ رِجْلَيْهَا قَالَتْ يَا عَبْدَ اللَّهِ اتَّقِ اللَّهَ، وَلاَ تَفْتَحِ الْخَاتَمَ إِلاَّ بِحَقِّهِ، فَقُمْتُ، فَإِنْ كُنْتَ تَعْلَمُ أَنِّي فَعَلْتُهُ ابْتِغَاءَ وَجْهِكَ فَافْرُجْ عَنَّا فَرْجَةً‏.‏ فَفَرَجَ‏.‏ وَقَالَ الثَّالِثُ اللَّهُمَّ إِنِّي اسْتَأْجَرْتُ أَجِيرًا بِفَرَقِ أَرُزٍّ، فَلَمَّا قَضَى عَمَلَهُ قَالَ أَعْطِنِي حَقِّي‏.‏ فَعَرَضْتُ عَلَيْهِ، فَرَغِبَ عَنْهُ، فَلَمْ أَزَلْ أَزْرَعُهُ حَتَّى جَمَعْتُ مِنْهُ بَقَرًا وَرَاعِيهَا فَجَاءَنِي فَقَالَ اتَّقِ اللَّهَ‏.‏ فَقُلْتُ اذْهَبْ إِلَى ذَلِكَ الْبَقَرِ وَرُعَاتِهَا فَخُذْ‏.‏ فَقَالَ اتَّقِ اللَّهَ وَلاَ تَسْتَهْزِئْ بِي‏.‏ فَقُلْتُ إِنِّي لاَ أَسْتَهْزِئُ بِكَ فَخُذْ‏.‏ فَأَخَذَهُ، فَإِنْ كُنْتَ تَعْلَمُ أَنِّي فَعَلْتُ ذَلِكَ ابْتِغَاءَ وَجْهِكَ فَافْرُجْ مَا بَقِيَ، فَفَرَجَ اللَّهُ ‏"‏‏.‏ قَالَ أَبُو عَبْدِ اللَّهِ وَقَالَ ابْنُ عُقْبَةَ عَنْ نَافِعٍ فَسَعَيْتُ‏.‏
Translation
Narrated `Abdullah bin `Umar

The Prophet (ﷺ) said, "While three men were walking, It started raining and they took shelter (refuge) in a cave in a mountain. A big rock rolled down from the mountain and closed the mouth of the cave. They said to each other, "Think of good deeds which you did for Allah's sake only, and invoke Allah by giving reference to those deeds so that He may remove this rock from you." One of them said, 'O Allah! I had old parents and small children and I used to graze the sheep for them. On my return to them in the evening, I used to milk (the sheep) and start providing my parents first of all before my children. One day I was delayed and came late at night and found my parents sleeping. I milked (the sheep) as usual and stood by their heads. I hated to wake them up and disliked to give milk to my children before them, although my children were weeping (because of hunger) at my feet till the day dawned. O Allah! If I did this for Your sake only, kindly remove the rock so that we could see the sky through it.' So, Allah removed the rock a little and they saw the sky. The second man said, 'O Allah! I was in love with a cousin of mine like the deepest love a man may have for a woman. I wanted to outrage her chastity but she refused unless I gave her one hundred Dinars. So, I struggled to collect that amount. And when I sat between her legs, she said, 'O Allah's slave! Be afraid of Allah and do not deflower me except rightfully (by marriage).' So, I got up. O Allah! If I did it for Your sake only, please remove the rock.' The rock shifted a little more. Then the third man said, 'O Allah! I employed a laborer for a Faraq of rice and when he finished his job and demanded his right, I presented it to him, but he refused to take it. So, I sowed the rice many time till I gathered cows and their shepherd (from the yield). (Then after some time) He came and said to me, 'Fear Allah (and give me my right)." I said, 'Go and take those cows and the shepherd.' He said, 'Be afraid of Allah! Don't mock at me.' I said, 'I am not mocking at you. Take (all that).' So, he took all that. O Allah! If I did that for Your sake only, please remove the rest of the rock.' So, Allah removed the rock."

Comment

Hadith of the Three Men in the Cave

Sahih al-Bukhari 2333 - Book of Agriculture

Commentary on the First Man's Deed

The first man's devotion to his parents exemplifies the highest form of birr al-walidayn (kindness to parents). His patience in serving them before his own children, despite their crying from hunger, demonstrates the priority Islam gives to parental rights. Standing all night with milk rather than disturbing their sleep shows extraordinary consideration. This deed was accepted because it was purely for Allah's pleasure, not for worldly recognition.

Commentary on the Second Man's Deed

This man's story illustrates the power of taqwa (God-consciousness) overcoming base desires. Though he had gathered the demanded sum and was in a position to commit sin, he heeded the woman's reminder and feared Allah. His abandonment of the act at the final moment, when desire was strongest, shows genuine piety. The acceptance of this deed teaches that fleeing from prohibited matters for Allah's sake is among the greatest of righteous actions.

Commentary on the Third Man's Deed

The third man's story demonstrates complete fulfillment of amanah (trust) and workers' rights. When the laborer initially refused his wages, the employer invested them honestly and gave him the multiplied returns. His willingness to surrender enormous profits that rightfully belonged to the worker shows exceptional honesty in financial dealings. This exemplifies the Islamic principle that workers must be paid fully and promptly for their labor.

Scholarly Insights

This hadith establishes that sincere deeds done purely for Allah can bring divine assistance in times of distress. The rock moved gradually with each story, showing that different deeds have different weights with Allah. The sequence also teaches that salvation often comes through collective supplication and remembrance of righteous deeds. Scholars note that all three men invoked Allah based on deeds involving their relationships with others, emphasizing that social responsibilities are integral to faith.