Awf ibn Malik reported: The Messenger of Allah, peace and blessings be upon him, performed the funeral prayer and I memorized his supplication, “O Allah, forgive him, have mercy on him, make him well, and pardon him. Dignify his residence and make his resting place spacious. Cleanse him with water, snow, and ice. Purify him from sins just as a white garment is purified from dirt. Offer him a home better than his home, people better than his people, and a wife better than his wife. Admit him into Paradise and save him from the punishment of the grave and the Hellfire.”
Awf said, “The Prophet continued supplicating until I wished that I had been that dead person.”
Source: Ṣaḥīḥ Muslim 963
Grade: Sahih (authentic) according to Muslim
عَنْ عَوْفِ بْنِ مَالِكٍ الْأَشْجَعِيِّ قَالَ صَلَّى رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ عَلَى جَنَازَةٍ فَحَفِظْتُ مِنْ دُعَائِهِ وَهُوَ يَقُولُ اللَّهُمَّ اغْفِرْ لَهُ وَارْحَمْهُ وَعَافِهِ وَاعْفُ عَنْهُ وَأَكْرِمْ نُزُلَهُ وَوَسِّعْ مُدْخَلَهُ وَاغْسِلْهُ بِالْمَاءِ وَالثَّلْجِ وَالْبَرَدِ وَنَقِّهِ مِنْ الْخَطَايَا كَمَا نَقَّيْتَ الثَّوْبَ الْأَبْيَضَ مِنْ الدَّنَسِ وَأَبْدِلْهُ دَارًا خَيْرًا مِنْ دَارِهِ وَأَهْلًا خَيْرًا مِنْ أَهْلِهِ وَزَوْجًا خَيْرًا مِنْ زَوْجِهِ وَأَدْخِلْهُ الْجَنَّةَ وَأَعِذْهُ مِنْ عَذَابِ الْقَبْرِ أَوْ مِنْ عَذَابِ النَّارِ
قَالَ حَتَّى تَمَنَّيْتُ أَنْ أَكُونَ أَنَا ذَلِكَ الْمَيِّتَ
963 صحيح مسلم كتاب الجنائز باب الدعاء للميت في الصلاة