Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ibnmajah:1550Hishām b. ʿAmmār > Ismāʿīl b. ʿAyyāsh > Layth b. Abū Sulaym > Nāfiʿ > Ibn ʿUmar

“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).”  

ابن ماجة:١٥٥٠حَدَّثَنَا هِشَامُ بْنُ عَمَّارٍ حَدَّثَنَا إِسْمَاعِيلُ بْنُ عَيَّاشٍ حَدَّثَنَا لَيْثُ بْنُ أَبِي سُلَيْمٍ عَنْ نَافِعٍ عَنِ ابْنِ عُمَرَ

عَنِ النَّبِيِّ ﷺ ح وَحَدَّثَنَا عَبْدُ اللَّهِ بْنُ سَعِيدٍ حَدَّثَنَا أَبُو خَالِدٍ الأَحْمَرُ حَدَّثَنَا الْحَجَّاجُ عَنْ نَافِعٍ عَنِ ابْنِ عُمَرَ قَالَ كَانَ النَّبِيُّ ﷺ إِذَا أُدْخِلَ الْمَيِّتُ الْقَبْرَ قَالَ بِسْمِ اللَّهِ وَعَلَى مِلَّةِ رَسُولِ اللَّهِ وَقَالَ أَبُو خَالِدٍ مَرَّةً إِذَا وُضِعَ الْمَيِّتُ فِي لَحْدِهِ قَالَ بِسْمِ اللَّهِ وَعَلَى سُنَّةِ رَسُولِ اللَّهِ وَقَالَ هِشَامٌ فِي حَدِيثِهِ بِسْمِ اللَّهِ وَفِي سَبِيلِ اللَّهِ وَعَلَى مِلَّةِ رَسُولِ اللَّهِ  


See similar narrations below:

Collected by Tirmidhī
tirmidhi:1046Abū Saʿīd al-Ashaj > Abū Khālid al-Aḥmar > al-Ḥajjāj > Nāfiʿ > Ibn ʿUmar

"When he Prophet put the deceased in the grave" He said: And Abu Khalid (one of the narrators) said [one time]: "When he placed the deceased in the Lahd" - "He said one time: 'In the Name of Allah, by His command and upon the Millah of the Messenger of Allah.' and one time he said: 'In the Name of Allah, by His command and upon the Sunnah of the Messenger of Allah."  

الترمذي:١٠٤٦حَدَّثَنَا أَبُو سَعِيدٍ الأَشَجُّ حَدَّثَنَا أَبُو خَالِدٍ الأَحْمَرُ حَدَّثَنَا الْحَجَّاجُ عَنْ نَافِعٍ عَنِ ابْنِ عُمَرَ

أَنَّ النَّبِيَّ ﷺ كَانَ إِذَا أُدْخِلَ الْمَيِّتُ الْقَبْرَ وَقَالَ أَبُو خَالِدٍ مَرَّةً إِذَا وُضِعَ الْمَيِّتُ فِي لَحْدِهِ قَالَ مَرَّةً بِسْمِ اللَّهِ وَبِاللَّهِ وَعَلَى مِلَّةِ رَسُولِ اللَّهِ وَقَالَ مَرَّةً بِسْمِ اللَّهِ وَبِاللَّهِ وَعَلَى سُنَّةِ رَسُولِ اللَّهِ ﷺ  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ غَرِيبٌ مِنْ هَذَا الْوَجْهِ وَقَدْ رُوِيَ هَذَا الْحَدِيثُ مِنْ غَيْرِ هَذَا الْوَجْهِ عَنِ ابْنِ عُمَرَ عَنِ النَّبِيِّ ﷺ وَرَوَاهُ أَبُو الصِّدِّيقِ النَّاجِيُّ عَنِ ابْنِ عُمَرَ عَنِ النَّبِيِّ ﷺ وَقَدْ رُوِيَ عَنْ أَبِي الصِّدِّيقِ النَّاجِيِّ عَنِ ابْنِ عُمَرَ مَوْقُوفًا أَيْضًا