The Prophet ﷺ said, "When the deceased is placed in his grave, he hears the sound of their sandals as they turn away from him. If he was a believer, the prayer stands at his head, fasting at his right, zakat at his left, and his good deeds of charity, maintaining ties of kinship, kindness, and goodness to people stand at his feet.He is approached from the direction of his head, and the prayer says, 'There is no entry from my side.' Then he is approached from his right, and fasting says, 'There is no entry from my side.' Then he is approached from his left, and zakat says, 'There is no entry from my side.' Then he is approached from the direction of his feet, and his good deeds of charity, maintaining ties of kinship, kindness, and goodness to people say, 'There is no entry from my side.'Then he is told, 'Sit up.' So he sits up, and the sun appears before him as though it has begun to set.He is asked, 'Tell us about this man who was among you. What do you say about him, and what do you testify concerning him?'He replies, 'Let me pray.'They say, 'You will do so. Tell us what we ask you. Tell us about this man who was among you. What do you say about him, and what do you testify concerning him?'He says, 'Muhammad. I testify that he is the Messenger of Allah ﷺ and that he came with the truth from Allah.'He is told, 'Upon this you lived, upon this you died, and upon this you will be resurrected, if Allah wills.'Then a door of Paradise is opened for him, and he is told, 'This is your place there, and what Allah has prepared for you in it.' So he increases in joy and delight. Then a door of Hell is opened for him, and he is told, 'This would have been your place there, and what Allah would have prepared for you in it had you disobeyed Him.' So he increases further in joy and delight.Then his grave is expanded for him seventy cubits and filled with light. His body is restored to its original state, and his soul is placed among the goodly souls, which are birds that perch in the trees of Paradise."The Prophet continued, "That is the meaning of His statement, 'Allah keeps firm those who believe with the firm word in the life of this world and in the Hereafter' [Ibrahim 14:27]."He said, "As for the disbeliever, when he is approached from the direction of his head, nothing is found. Then he is approached from his right, and nothing is found. Then he is approached from his left, and nothing is found. Then he is approached from the direction of his feet, and nothing is found.He is told, 'Sit up.' So he sits up, frightened and terrified.He is asked, 'Tell us about this man who was among you. What do you say about him, and what do you testify concerning him?'He says, 'Which man?'He is told, 'The one who was among you.' He cannot recall his name until it is said to him, 'Muhammad.'He says, 'I do not know. I heard people saying something, so I said what they said.'He is told, 'Upon this you lived, upon this you died, and upon this you will be resurrected, if Allah wills.'Then a door of Hell is opened for him, and he is told, 'This is your place in the Fire, and what Allah has prepared for you in it.' So he increases in regret and ruin. Then a door of Paradise is opened for him, and he is told, 'That would have been your place in Paradise, and what Allah would have prepared for you in it had you obeyed Him.' So he increases further in regret and ruin.Then his grave is constricted upon him until his ribs interlock. That is the straitened life of which Allah said, 'Indeed, he will have a straitened life, and We will gather him on the Day of Resurrection blind' [Taha 20:124]."
عن النبي ﷺ قال: إن الميت إذا وضع في قبره إنه يسمع خفق نعالهم حين يولون عنه، فإن كان مؤمنا، كانت الصلاة عند رأسه، وكان الصيام عن يمينه، وكانت الزكاة عن شماله، وكان فعل الخيرات من الصدقة والصلة والمعروف والإحسان إلى الناس عند رجليه. فيؤتي من قبل رأسه، فتقول الصلاة ما قبلي مدخل، ثم يؤتي عن يمينه، فيقول الصيام ما قبلي مدخل، ثم يؤتي عن يساره، فتقول الزكاة: ما قبلي مدخل، ثم يؤتي من قبل رجليه، فتقول فعل الخيرات من الصدقة والصلة والمعروف والإحسان إلى الناس ما قبلي مدخل، فيقال له اجلس فيجلس، وقد مثلت له الشمس، وقد أذنيت للغروب، فيقال له: أرأيتك هذا الرجل الذي كان فيكم ما تقول فيه، وماذا تشهد به عليه؟ فيقول: دعوني حتى أصلي، فيقولون: إنك ستفعل، أخبرني عما نسألك عنه، أرأيتك هذا الرجل الذي كان فيكم ما تقول فيه، وماذا تشهد عليه؟ قال: فيقول: محمد أشهد أنه رسول الله ﷺ، وأنه جاء بالحق من عند الله، فيقال له على ذلك حييت وعلى ذلك مت، وعلى ذلك تبعث إن شاء الله، ثم يفتح له باب من أبواب الجنة، فيقال له: هذا مقعدك منها، وما أعد الله لك فيها، فيزداد غبطة وسرورا، ثم يفتح له باب من أبواب النار، فيقال له: هذا مقعدك منها وما أعد الله لك فيها لو عصيته، فيزداد غبطة وسرورا، ثم يفسح له في قبره سبعون ذراعا، وينور له فيه، ويعاد الجسد كما بدأ منه، فتجعل نسمته في النسم الطيب، وهي طير يعلق في شجر الجنة، قال: فذلك قوله تعالى: {يثبت الله الذين ءامنوا بالقول الثابت في الحيوة الدنيا وفي الآخرة} [إبراهيم: ٢٧]. قال: إن الكافر إذا أتى من قبل رأسه، لم يوجد شيء، ثم أتى عن يمينه، فلا يوجد شيء، ثم أتى عن شماله، فلا يوجد شيء، ثم أتى من قبل رجليه، فلا يوجد شيء، فيقال له: اجلس، فيجلس خائفا مرعوبا، فيقال له: أرأيتك هذا الرجل الذي كان فيكم ماذا تقول فيه؟ وماذا تشهد به عليه؟ فيقول: أي رجل؟ فيقال: الذي كان فيكم، فلا يهتدي لاسمه حتى يقال له: محمد، فيقول: ما أدري سمعت الناس قالوا قولا، فقلت كما قال الناس، فيقال له على ذلك حييت، وعلى ذلك مت، وعلى ذلك تبعث إن شاء الله، ثم يفتح له باب من أبواب النار، فيقال له: هذا مقعدك من النار، وما أعد الله لك فيها، فيزداد حسرة وثبورا، ثم يفتح له باب من أبواب الجنة، فيقال له: ذلك مقعدك من الجنة، وما أعد الله لك فيه لو أطعته فيزداد حسرة وثبورا، ثم يضيق عليه قبره حتى تختلف فيه أضلاعه، فتلك المعيشة الضنكة التي قال الله: {فإن له معيشة ضنكا ونحشره يوم القيامة أعمي} [طه: ١٢٤].
Ibn Hibban (3113) narrated it from Hasan bin Sufyan, who said, Abdul-Wahid bin Ghiyath narrated to us, who said, Mutamir bin Sulayman narrated to us, who said, I heard Muhammad bin Amr narrating from Abu Salama, from Abu Hurairah, and he mentioned it. Its isnad is hasan because of Muhammad bin Amr, who is Ibn Alqama bin Waqqas Laythi, for his hadith is hasan.Hakim also related it (1/379-381) through Saeed bin Amir, and Bayhaqi in Ithbat Azab Qabr (79) through Abdul-Wahhab bin Ata, both of them from Muhammad bin Amr. Hakim then narrated it through Hammad bin Salama, from Muhammad bin Amr in abridged form, and said, "The hadith of Saeed bin Amir is more complete," and said, "It is sahih according to the criterion of Muslim."I say, it is as he said, and although Muhammad bin Amr is among the narrators used by the community of scholars, there is some minor criticism of him that makes his hadith hasan.Haythami attributed it in al-Majmu (3/51-52) to Tabarani in Mujam al-Awsat and graded its isnad hasan.