The Prophet ﷺ mentioned ar-Raqim and said, "Three men were in a cave when a boulder fell across its entrance and sealed them inside. One of them said, 'Recall whatever good deed any of you has done, perhaps Allah will have mercy on us through it.'One of them said, 'I once did a good deed. I used to hire laborers to work for me. One day my workers came to me, and I hired each man at an agreed wage. Then a man came to me at midday, so I hired him on the same terms as his companions. He worked the rest of the day as much as each of the others had worked the whole day. I felt bound in honor not to reduce his pay below what I had agreed with his companions, given how hard he had labored. One of them said, 'Are you giving this man the same as you gave me, when he only worked half a day?' I said, 'Servant of Allah, I have not cheated you of anything you agreed to. This is my own wealth, and I dispose of it as I wish.' He grew angry, walked away, and left his wages behind. So I set his portion aside in a corner of the house. Time passed as Allah willed. Later, some cattle came my way, and I bought a young calf with his money, which grew until it became as much as Allah willed.After a long time, an old, frail man whom I did not recognize passed by me and said, 'I have something owed to me with you.' He kept reminding me until I recognized him. I said, 'You are the very one I have been seeking. This is what is yours.' I offered the entire herd to him. He said, 'Servant of Allah, do not mock me. If you cannot give me freely, just give me what is mine.' I said, 'By Allah, I am not mocking you. All of this is yours. None of it belongs to me.' And I handed it all over to him.O Allah, if I did this seeking Your face, relieve us.'The boulder split apart enough that they could see through it.The second said, 'I once did a good deed. I had wealth, and a hardship struck the people. A woman came to me asking for help. I said, 'By Allah, only at the price of yourself.' She refused and left. Then she came back and reminded me of Allah, but I refused her and said, 'No, by Allah, only at the price of yourself.' She refused and left. She told her husband, who said to her, 'Give him yourself and feed our children.' She returned to me and pleaded with me by Allah, but I refused and said, 'By Allah, only at the price of yourself.' When she saw this, she submitted herself to me. But when I uncovered her and was about to take her, she trembled beneath me. I asked, 'What is the matter with you?' She said, 'I fear Allah, Lord of the worlds.' I said to her, 'You feared Him in hardship, and I have not feared Him in ease.' So I left her and gave her what I had pledged for uncovering her.O Allah, if I did this seeking Your face, relieve us.'The split widened until things became clear and visible to them.The third said, 'I once did a good deed. I had two elderly parents, and I had a flock of sheep. I would feed my parents and give them to drink, then return to my flock. One day rain caught me and kept me away, and I did not return until evening. I came to my family, took my milking pail, milked the sheep while my flock stood waiting, and went out to my parents. I found them already asleep. I did not want to wake them, but I also could not leave my flock. So I remained sitting, holding the pail in my hand, until dawn woke them, and then I gave them their drink.O Allah, if I did this seeking Your face, relieve us.'"Numan said, "It is as if I am still hearing this from the Messenger of Allah ﷺ." He said, "The boulder split fully open, Allah relieved them, and they came out."
أنه سمع رسول الله ﷺ يذكر الرقيم فقال: إن ثلاثة نفر كانوا في كهف، فوقع الجبل على باب الكهف، فأوصد عليهم، قال قائل منهم: تذاكروا أيكم عمل حسنة، لعل الله عز وجل برحمته يرحمنا، فقال رجل منهم: قد عملت حسنة مرة: كان لي أجراء يعملون، فجاءني عمال لي، استأجرت كل رجل منهم بأجر معلوم، فجاءني رجل ذات يوم وسط النهار، فاستأجرته بشرط أصحابه، فعمل في بقية نهاره، كما عمل كل رجل منهم في نهاره كله، فرأيت علي في الذمام أن لا أنقصه مما استأجرت به أصحابه، لما جهد في عمله، فقال رجل منهم: أتعطي هذا مثل ما أعطيتني، ولم يعمل إلا نصف نهار؟ فقلت: يا عبد الله، لم أبخسك شيئا من شرطك، وإنما هو مالي أحكم فيه ما شئت، قال: فغضب، وذهب، وترك أجره، قال: فوضعت حقه في جانب من البيت ما شاء الله، ثم مرت بي بعد ذلك بقر، فاشتريت به فصيلة من البقر، فبلغت ما شاء الله، فمر بي بعد حين شيخا ضعيفا لا أعرفه، فقال: إن لي عندك حقا فذكرنيه حتى عرفته، فقلت: إياك أبغي، هذا حقك، فعرضتها عليه جميعها، فقال: يا عبد الله، لا تسخر بي، إن لم تصدق علي، فأعطني حقي، قال: والله ما أسخر بك: إنها لحقك، ما لي منها شيء، فدفعتها إليه جميعا. اللهم إن كنت فعلت ذلك لوجهك، فافرج عنا. قال: فانصدع الجبل حتى رأوا منه، وأبصروا. قال الآخر: قد عملت حسنة مرة كان لي فضل، فأصابت الناس شدة، فجاءتني امرأة تطلب مني معروفا، قال: فقلت: والله ما هو دون نفسك، فأبت علي، فذهبت، ثم رجعت، فذكرتني بالله، فأبيت عليها وقلت: لا والله ما هو دون نفسك، فأبت علي، وذهبت، فذكرت لزوجها، فقال لها: أعطيه نفسك، وأغني عيالك، فرجعت إلي، فناشدتني بالله، فأبيت عليها، وقلت: والله ما هو دون نفسك، فلما رأت ذلك أسلمت إلي نفسها، فلما تكشفتها، وهممت بها، ارتعدت من تحتي، فقلت لها: ما شأنك؟ قالت: أخاف الله رب العالمين، قلت لها: خفتيه في الشدة، ولم أخفه في الرخاء. فتركتها وأعطيتها ما يحق علي بما تكشفتها. اللهم إن كنت فعلت ذلك لوجهك، فافرج عنا. قال: فانصدع حتى عرفوا وتبين لهم. قال الآخر: عملت حسنة مرة، كان لي أبوان شيخان كبيران، وكانت لي غنم، فكنت أطعم أبوي، وأسقيهما، ثم رجعت إلى غنمي، قال: فأصابني يوما غيث حبسني، فلم أبرح حتى أمسيت، فأتيت أهلي وأخذت محلبي، فحلبت وغنمي قائمة، فمضيت إلى أبوي، فوجدتهما قد ناما، فشق علي أن أوقظهما، وشق علي أن أترك غنمي، فما برحت جالسا، ومحلبي على يدي حتى أيقظهما الصبح، فسقيتهما. اللهم إن كنت فعلت ذلك لوجهك، فافرج عنا. قال النعمان: لكأني أسمع هذه من رسول الله ﷺ، قال: الجبل طاق، ففرج الله عنهم، فخرجوا.
Ahmad narrated it (18417), and Tabarani in al-Dua (190), both from the hadith of Ismail bin Abdul-Kareem bin Maqil bin Munabbih, who said, Abdul-Samad, meaning bin Maqil, told me, he said, I heard Wahb say, Numan bin Bashir told me, and he related it.Its chain is hasan because of Ismail bin Abdul-Kareem and Abdul-Samad bin Maqil, for they are both truthful (saduq). Ibn Hajar graded it hasan in Fath al-Bari (6/506). The hadith has other routes from Numan bin Bashir, but the one I have mentioned here is the most sahih.As for his statement, "that he heard the Messenger of Allah ﷺ mention al-Raqeem," the Raqeem mentioned here is not the same as the People of the Cave mentioned in His statement, the Exalted, "Or did you think that the companions of the cave and al-Raqeem were, among Our signs, a wonder?" [Kahf 18:9]. This is because what is meant there is a stone tablet on which the story of the People of the Cave was written, which was then placed at the entrance of the cave. In the hadith mentioned here, however, it is the name of the valley in which the cave is located.