Mishkat al-Masabih 135
عَن جَابر بن عبد الله قَالَ خَرَجْنَا مَعَ رَسُولِ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِلَى سَعْدِ بْنِ مُعَاذٍ حِينَ توفّي قَالَ فَلَمَّا صَلَّى عَلَيْهِ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَوُضِعَ فِي قَبْرِهِ وَسُوِّيَ عَلَيْهِ سَبَّحَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَسَبَّحْنَا طَوِيلًا ثُمَّ كَبَّرَ فَكَبَّرْنَا فَقِيلَ يَا رَسُولَ اللَّهِ لِمَ سَبَّحَتْ ثُمَّ كَبَّرْتَ قَالَ: «لقد تضايق على هَذَا العَبْد الصَّالح قَبره حَتَّى فرجه الله عز وَجل عَنهُ» . رَوَاهُ أَحْمد
From Jabir ibn ʿAbdullah, who said: We went out with the Messenger of Allah ﷺ to Saʿd ibn Muʿadh when he died. He said: When the Messenger of Allah ﷺ had prayed over him, and he was placed in his grave and [the earth] levelled over him, the Messenger of Allah ﷺ glorified [Allah], and we glorified for a long time. Then he said the takbir, and we said the takbir. It was said: "O Messenger of Allah, why did you glorify and then say the takbir?" He said: "The grave of this righteous slave became tight upon him, until Allah, Mighty and Majestic, relieved it from him." Reported by Ahmad.