حَدَّثَنَا هِشَامُ بْنُ عَمَّارٍ، حَدَّثَنَا إِسْمَاعِيلُ بْنُ عَيَّاشٍ، حَدَّثَنَا لَيْثُ بْنُ أَبِي سُلَيْمٍ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، عَنِ النَّبِيِّ ـ صلى الله عليه وسلم ـ ح وَحَدَّثَنَا عَبْدُ اللَّهِ بْنُ سَعِيدٍ، حَدَّثَنَا أَبُو خَالِدٍ الأَحْمَرُ، حَدَّثَنَا الْحَجَّاجُ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ كَانَ النَّبِيُّ ـ صلى الله عليه وسلم ـ إِذَا أُدْخِلَ الْمَيِّتُ الْقَبْرَ قَالَ ‏"‏ بِسْمِ اللَّهِ وَعَلَى مِلَّةِ رَسُولِ اللَّهِ ‏"‏ ‏.‏ وَقَالَ أَبُو خَالِدٍ مَرَّةً إِذَا وُضِعَ الْمَيِّتُ فِي لَحْدِهِ قَالَ ‏"‏ بِسْمِ اللَّهِ وَعَلَى سُنَّةِ رَسُولِ اللَّهِ ‏"‏ ‏.‏ وَقَالَ هِشَامٌ فِي حَدِيثِهِ ‏"‏ بِسْمِ اللَّهِ وَفِي سَبِيلِ اللَّهِ وَعَلَى مِلَّةِ رَسُولِ اللَّهِ ‏"‏ ‏.‏
Translation
It wasnarrated that Sa’eed bin Musayyab said

“I was present withIbn‘Umar at a funeral. When the body was placed in the niche-grave)hesaid, ‘Bismillah wa fi sabil-illah wa ‘ala millati rasul-illah’(Inthe Name of Allah, for the sake of Allah and according to thereligionof the Messenger of Allah). When he started to place bricksin theniche-grave he said: ‘Allahumma ajirha min ash-shaitani wamin‘adhabil-qabr. Allahumma Jafil-arda ‘an janbaiha, wa sa’idruhaha, walaqqiha minka ridwana (O Allah, protect him from Satan andfrom thetorment of the grave; O Allah, keep the earth away from histwo sidesand take his soul up and grant him pleasure fromYourself).’ I said:‘O Ibn ‘Umar, is this something that youheard from the Messenger ofAllah (ﷺ) or is it your own words?’He said: ‘I could have saidsomething like that, but this issomething that I heard from theMessenger of Allah (ﷺ).’”