عَنْ جَابِرِ بْنِ عَبْدِ اللَّهِ الْأَنْصَارِيِّ رَضِيَ اللَّهُ عَنْهُمَا قَالَ: خَرَجْنَا مَعَ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ يَوْمًا إِلَى سَعْدِ بْنِ مُعَاذٍ رَضِيَ اللَّهُ عَنْهُ، حِينَ تُوُفِّيَ، قَالَ: فَلَمَّا صَلَّى اللَّهُ عَلَيْهِ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ وَوُضِعَ فِي قَبْرِهِ وَسُوِّيَ عَلَيْهِ سَبَّحَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ فَسَبَّحْنَا طَوِيلًا، ثُمَّ كَبَّرَ فَكَبَّرْنَا، فَقِيلَ: يَا رَسُولَ اللَّهِ! لِمَ سَبَّحْتَ، ثُمَّ كَبَّرْتَ؟ قَالَ: لَقَدْ تَضَايَقَ عَلَى هَذَا الْعَبْدِ الصَّالِحِ قَبْرُهُ حَتَّى فَرَّجَهُ اللَّهُ عَزَّ وَجَلَّ عَنْهُ
Sayyiduna Jabir bin Abdullah (may Allah be pleased with him) narrates: When Sa’d bin Mu’adh (may Allah be pleased with him) passed away, we went along with the Messenger of Allah (peace and blessings be upon him). The Prophet (peace and blessings be upon him) led his funeral prayer. Afterwards, when he was placed in the grave and the earth was leveled over him, the Messenger of Allah (peace and blessings be upon him) kept reciting “Subhan Allah” and “Allahu Akbar” for a long time. We also kept saying “Subhan Allah” and “Allahu Akbar” along with him. It was asked: O Messenger of Allah! What was the reason for saying “Subhan Allah” and “Allahu Akbar” at this moment? He replied: The grave had become constricted for this righteous servant, until Allah Almighty made it spacious for him.