It is narrated from Hazrat Asma that the Prophet (peace be upon him) said: When a person is placed in his grave and he is a believer, his deeds such as prayer and fasting surround him. When the angel of punishment wants to come from the side of the prayer, the prayer stops him; if he wants to come from the side of fasting, the fasting stops him. The angel calls him and tells him to sit, so the person sits up. The angel asks him: What do you say about this man, meaning the Prophet (peace be upon him)? He asks: Which man? The angel says: Muhammad (peace be upon him). He says: I bear witness that he is the Messenger of Allah. The angel says: You lived upon this, you died upon this, and you will be raised upon this.
And if the deceased is a sinner or a disbeliever, then when the angel comes to him, there is nothing to turn him back. The angel makes him sit and asks: What do you say about this man? The deceased asks: Which man? The angel says: Muhammad (peace be upon him). The deceased says: By Allah, I do not know anything; I used to say what I heard people saying. The angel says: You lived upon this, you died upon this, and you will be raised upon this. Then a creature is set upon him in the grave, which has a whip with a spark at its tip, like the point of a camel. It will keep striking him as long as Allah wills. That creature is deaf and cannot hear any sound, so it will not have mercy on him.
Hadith Referenceمسند احمد / مسند النساء / 26976
Hadith Gradingحکم دارالسلام:رجاله ثقات، لم يذكر سماع محمد بن المنكدر من اسماء، وهو قد ادركها