عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ رَضِيَ اللَّهُ عَنْهُ قَالَ: شَهِدْتُّ مَعَ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ جَنَازَةً فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ: ((يَا أَيُّهَا النَّاسُ! إِنَّ هَذِهِ الْأُمَّةَ تُبْتَلَى فِي قُبُورِهَا، فَإِذَا الْإِنْسَانُ دُفِنَ فَتَفَرَّقَ عَنْهُ أَصْحَابُهُ، جَاءَهُ مَلَكٌ، فِي يَدِهِ مِطْرَاقٌ فَأَقْعَدَهُ قَالَ: مَا تَقُولُ فِي هَذَا الرَّجُلِ؟ فَإِنْ كَانَ مُؤْمِنًا قَالَ: أَشْهَدُ أَنْ لَا إِلَهَ إِلَّا اللَّهُ وَأَنَّ مُحَمَّدًا عَبْدُهُ وَرَسُولُهُ، فَيَقُولُ: صَدَقْتَ، ثُمَّ يُفْتَحُ لَهُ بَابٌ إِلَى النَّارِ فَيَقُولُ: هَذَا كَانَ مَنْزِلُكَ لَوْ كَفَرْتَ بِرَبِّكَ، فَأَمَّا إِذْ آمَنْتَ فَهَذَا مَنْزِلُكَ، فَيُفْتَحُ لَهُ بَابٌ إِلَى الْجَنَّةِ فَيُرِيدُ أَنْ يَنْهَضَ إِلَيْهِ، فَيَقُولُ لَهُ: اسْكُنْ وَيُفْسَحُ لَهُ فِي قَبْرِهِ (وَإِنْ كَانَ كَافِرًا أَوْ مُنَافِقًا) يَقُولُ لَهُ: مَا تَقُولُ فِي هَذَا الرَّجُلِ؟ فَيَقُولُ: لَا أَدْرِي، سَمِعْتُ النَّاسَ يَقُولُونَ شَيْئًا فَيَقُولُ: لَا دَرَيْتَ وَلَا تَلَيْتَ وَلَا اهْتَدَيْتَ، ثُمَّ يُفْتَحُ بَابٌ إِلَى جَنَّةٍ فَيَقُولُ: هَذَا مَنْزِلُكَ لَوْ آمَنْتَ بِرَبِّكَ، فَأَمَّا إِذْ كَفَرْتَ بِهِ فَإِنَّ اللَّهَ عَزَّ وَجَلَّ أَبْدَلَكَ بِهِ هَذَا وَيُفْتَحُ لَهُ بَابٌ إِلَى النَّارِ، ثُمَّ يَقْمَعُهُ قَمْعَةً بِالْمِطْرَاقِ يَسْمَعُهَا خَلْقُ اللَّهِ كُلُّهُمْ غَيْرَ الثَّقَلَيْنِ))، فَقَالَ بَعْضُ الْقَوْمِ: يَا رَسُولَ اللَّهِ! مَا أَحَدٌ يَقُومُ عَلَيْهِ مَلَكٌ فِي يَدِهِ مِطْرَاقٌ إِلَّا هَبَلَ عِنْدَ ذَلِكَ؟ فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ: {يُثَبِّتُ اللَّهُ الَّذِينَ آمَنُوا بِالْقَوْلِ الثَّابِتِ}
Sayyiduna Abu Sa'id Khudri (may Allah be pleased with him) says: I was with the Messenger of Allah (peace and blessings be upon him) at a funeral, and the Messenger of Allah (peace and blessings be upon him) said: O people! This Ummah will be tested in their graves. When a person is buried and his companions leave him, an angel comes to him with a mace in his hand. He makes the deceased sit up and asks: What do you say about this man (i.e., Muhammad, the Messenger of Allah, peace and blessings be upon him)? If he is a believer, he says: I bear witness that there is no god but Allah and Muhammad (peace and blessings be upon him) is His servant and Messenger. Upon hearing this, the angel says: You have spoken the truth. Then a door towards Hell is opened for him, and the angel says: If you had disbelieved in your Lord, this would have been your abode, but now you are a believer, so your abode is this. Then a door from Paradise is opened for him, and when the deceased intends to move towards it, the angel says: Remain at ease (here). Then his grave is expanded for him. And if the deceased is a disbeliever or a hypocrite, the angel asks him: What do you say about this person (Muhammad, peace and blessings be upon him)? He says: I do not know anything, I only used to hear people saying something. The angel says: You neither understood, nor recited, nor received guidance. After that, a door from Paradise is opened for him, and the angel says: If you had believed in your Lord, this would have been your abode, but since you have disbelieved in your Lord, Allah Almighty has prepared another abode for you instead. Then a door towards Hell is opened for him, and the angel strikes him with a mighty blow from the mace, the sound of which is heard by all of Allah's creation except jinn and mankind. Upon hearing this hadith, some people said: O Messenger of Allah! When the angel stands by a person with a mace in his hand, will he not be terrified? The Messenger of Allah (peace and blessings be upon him) recited this verse in reply: {یُثَبِّتُ اللّٰہُ الَّذِیْنَ آمَنُوْا بِالْقَوْلِ الثَّابِتِ۔} (Surah Ibrahim: 27) meaning: Allah keeps the believers firm on the word of Tawheed.