Bulugh al-Maram 582
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
وَعَنْ ضَمْرَةَ بْنِ حَبِيبٍ أَحَدِ التَّابِعِينَ قَالَ: { كَانُوا يَسْتَحِبُّونَ إِذَا سُوِّيَ عَلَى الْمَيِّتِ قَبْرُهُ, وَانْصَرَفَ اَلنَّاسُ عَنْهُ, أَنْ يُقَالَ عِنْدَ قَبْرِهِ: يَا فُلَانُ! قُلْ: لَا إِلَهَ إِلَّا اَللَّهُ. ثَلَاثُ مَرَّاتٍ, يَا فُلَانُ! قُلْ: رَبِّيَ اللَّهُ, وَدِينِيَ الْإِسْلَامُ, وَنَبِيِّ مُحَمَّدٌ - صلى الله عليه وسلم -} رَوَاهُ سَعِيدُ بْنُ مَنْصُورٍ مَوْقُوفًا . 1 .
Damrah bin Habib (one of the Tabi'in or the followers of the Companions) narrated, "They (the Companions that he met) recommended that after the grave is leveled and the people leave, that one should stand by the grave and say three times to the deceased, 'O so-and-so, say:
"There is no god but Allah" , 'O so-and-so, say: "Allah is my Lord, Islam is my din (religion), and Muhammad is my prophet." Related by Sa'id bin Mansur.
Full reference and source
Bulugh al-Maram 582 In-book : Book 3, Hadith 51 English translation : Book 3, Hadith 607
View source on Sunnah.com (opens in a new tab)