Sunan Ibn Majah, Book 6, Hadith 1617 (In-Book) ⓘ
It was narrated that Ibn ‘Umar said: “When the deceased was placed in the grave, the Prophet would say: ‘Bismillah, wa ‘ala millati rasul-illah (In the Name of Allah and according to the religion of the Messenger of Allah).’” Abu Khalid said on one occasion, when the deceased was placed in the grave: “Bismillah wa ‘ala sunnati rasul- illah (In the Name of Allah and according to the Sunnah of the Messenger of Allah).” Hisham said in his narration: “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).”
حَدَّثَنَا هِشَامُ بْنُ عَمَّارٍ، حَدَّثَنَا إِسْمَاعِيلُ بْنُ عَيَّاشٍ، حَدَّثَنَا لَيْثُ بْنُ أَبِي سُلَيْمٍ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، عَنِ النَّبِيِّ ـ صلى الله عليه وسلم ـ ح وَحَدَّثَنَا عَبْدُ اللَّهِ بْنُ سَعِيدٍ، حَدَّثَنَا أَبُو خَالِدٍ الأَحْمَرُ، حَدَّثَنَا الْحَجَّاجُ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ كَانَ النَّبِيُّ ـ صلى الله عليه وسلم ـ إِذَا أُدْخِلَ الْمَيِّتُ الْقَبْرَ قَالَ " بِسْمِ اللَّهِ وَعَلَى مِلَّةِ رَسُولِ اللَّهِ " . وَقَالَ أَبُو خَالِدٍ مَرَّةً إِذَا وُضِعَ الْمَيِّتُ فِي لَحْدِهِ قَالَ " بِسْمِ اللَّهِ وَعَلَى سُنَّةِ رَسُولِ اللَّهِ " . وَقَالَ هِشَامٌ فِي حَدِيثِهِ " بِسْمِ اللَّهِ وَفِي سَبِيلِ اللَّهِ وَعَلَى مِلَّةِ رَسُولِ اللَّهِ " .
also referenced under: Hadith 1550 (Reference) & Volume 2, Book 6, Hadith 1550 (DarusSalam)