Sunan Ibn Majah, Book 6, Hadith 1620 (In-Book) ⓘ
It was narrated that Sa’eed bin Musayyab said: “I was present with Ibn ‘Umar at a funeral. When the body was placed in the niche-grave) he said, ‘Bismillah wa fi sabil-illah wa ‘ala millati rasul-illah’ (In the Name of Allah, for the sake of Allah and according to the religion of the Messenger of Allah). When he started to place bricks in the niche-grave he said: ‘Allahumma ajirha min ash-shaitani wa min ‘adhabil-qabr. Allahumma Jafil-arda ‘an janbaiha, wa sa’id ruhaha, wa laqqiha minka ridwana (O Allah, protect him from Satan and from the torment of the grave; O Allah, keep the earth away from his two sides and take his soul up and grant him pleasure from Yourself).’ I said: ‘O Ibn ‘Umar, is this something that you heard from the Messenger of Allah or is it your own words?’ He said: ‘I could have said something like that, but this is something that I heard from the Messenger of Allah.’”
حَدَّثَنَا هِشَامُ بْنُ عَمَّارٍ، حَدَّثَنَا حَمَّادُ بْنُ عَبْدِ الرَّحْمَنِ الْكَلْبِيُّ، حَدَّثَنَا إِدْرِيسُ الأَوْدِيُّ، عَنْ سَعِيدِ بْنِ الْمُسَيَّبِ، قَالَ حَضَرْتُ ابْنَ عُمَرَ فِي جِنَازَةٍ فَلَمَّا وَضَعَهَا فِي اللَّحْدِ قَالَ بِسْمِ اللَّهِ وَفِي سَبِيلِ اللَّهِ وَعَلَى مِلَّةِ رَسُولِ اللَّهِ . فَلَمَّا أُخِذَ فِي تَسْوِيَةِ اللَّبِنِ عَلَى اللَّحْدِ قَالَ اللَّهُمَّ أَجِرْهَا مِنَ الشَّيْطَانِ وَمِنْ عَذَابِ الْقَبْرِ اللَّهُمَّ جَافِ الأَرْضَ عَنْ جَنْبَيْهَا وَصَعِّدْ رُوحَهَا وَلَقِّهَا مِنْكَ رِضْوَانًا . قُلْتُ يَا ابْنَ عُمَرَ أَشَىْءٌ سَمِعْتَهُ مِنْ رَسُولِ اللَّهِ ـ صلى الله عليه وسلم ـ أَمْ قُلْتَهُ بِرَأْيِكَ قَالَ إِنِّي إِذًا لَقَادِرٌ عَلَى الْقَوْلِ بَلْ شَىْءٌ سَمِعْتُهُ مِنْ رَسُولِ اللَّهِ ـ صلى الله عليه وسلم ـ .
also referenced under: Hadith 1553 (Reference) & Volume 2, Book 6, Hadith 1553 (DarusSalam)