When the Messenger of Allah ﷺ stood to perform the funeral prayer over a deceased person, he would say, "O Allah, Your servant and the son of Your maidservant is in need of Your mercy, and You have no need to punish him. If he was a doer of good, increase his good deeds, and if he was a wrongdoer, overlook his sins."
كان رسول الله ﷺ إذا قام للجنازة ليصلي عليها قال: اللهم عبدك وابن أمتك احتاج إلى رحمتك، وأنت غني عن عذابه، إن كان محسنا فزد في إحسانه، وإن كان مسيئا فتجاوز عنه.
Hakam narrated it (359/1) from Abu Muhammad Abdul-Aziz bin Abdul-Rahman Khallal in Makkah, who said, Abdul-Rahman bin Ishaq the scribe narrated to us, Ibrahim bin Munzir Hizami narrated to us, Husayn bin Zayd bin Ali bin Husayn bin Ali narrated to us, from Jafar bin Muhammad, from his father, from Yazid bin Rukana, and he mentioned it. Hakam said, "This isnad is sahih, and Yazid bin Rukana and his father Rukana bin Abd Yazid are two companions from the Banu Muttalib bin Abd Manaf, and Bukhari and Muslim did not narrate from them."I say, Yazid bin Rukana and his father are two companions as Hakam said, and Ibn Abdul-Barr also confirmed this in Istiab. Ibn Qani and Tabarani narrated, via Husayn bin Zayd bin Ali, from his cousin Jafar bin Muhammad, the aforementioned hadith. Hafiz mentioned it in Isabah (655/3).I say, as for Tabarani, he narrated it in Mujam al-Kabir (22/249) through another route, from Yaqub bin Humayd bin Kasib, who said, Husayn bin Zayd bin Ali narrated to us with his isnad in the same way, "and in it, he said the takbir over the deceased four times," and he added at the end of the hadith, "then he prays whatever Allah wills him to pray." In it is Yaqub bin Humayd bin Kasib, the Madinan who resided in Makkah, who is sometimes attributed to his grandfather. Ibn Main, Abu Hatim, Nasai and others criticized him. Hafiz Haythami referred to this in Majma (34/3), saying, "Tabarani narrated it in al-Kabir, and in it is Yaqub bin Humayd, and there is criticism of him."I say, the criticism of him does no harm, because Ibrahim bin Munzir Hizami corroborated him in the isnad of Hakam, and his hadith is hasan. Daraqutni deemed him trustworthy, and Abu Hatim said, "Truthful," and Nasai said, "There is no harm in him." Hafiz placed him at the rank of "truthful" and said, "Ahmad criticized him because of the Quran, and he is among the narrators of Bukhari but not Muslim."As for what is narrated from Ibn Abbas as a raised report ﷺ, that when he prayed over a deceased person he said, "O Allah, forgive our living and our dead, our males and our females, our young and our old. Whoever among us You keep alive, keep him alive upon Islam, and whoever among us You take, take him upon faith. O Allah, grant Your pardon, grant Your pardon," its isnad is daif, but the hadith itself is sahih. Tabarani narrated it in Mujam al-Kabir, and in al-Awsat, Majma Bahrayn (1286), from Ahmad, who said, Ubayd narrated to us, Ata bin Muslim Khaffaf narrated to us, from Ala bin Musayab, from Habib bin Abu Thabit, from Ibn Abbas, and he mentioned it.Bukhari said about Ata bin Muslim Khaffaf, "I do not know him." Abu Dawud said, "Daif." Imam Ahmad said, "His hadith is disordered." Ibn Hibban said, "He was a righteous shaykh who buried his books, then began narrating from memory, so he would report things based on assumption and err, and thus many odd reports occurred in his narrations, and reliance upon him became invalid except where he agreed with the trustworthy narrators." Majruhin (724). Ibn Jawzi also mentioned him in Duafa.But Ibn Main had a good opinion of him because of his righteousness, and so deemed him trustworthy. Haythami said in Majma (33/3), "Its isnad is hasan," and that was based on Ibn Hibban mentioning him in Thiqat (255/7), and this is one of the matters in which Ibn Hibban contradicted himself. Allah is the one whose help is sought.Likewise, what is narrated from Ayesha as a raised report is not sound, "O Allah, forgive him, have mercy on him, grant him blessing, and bring him to the pool of Your Messenger." Tabarani narrated it in al-Awsat, Majma Bahrayn (1287), and Abu Yaala in Maqsad Ali (464), both from the hadith of Zakariya bin Yahya Raqashi Hazzaz, who said, Asim bin Hilal narrated to us, Ayub Sakhtiyani narrated to us, from Hisham bin Urwa, from his father, from Ayesha, and he mentioned it.The wording is Tabarani's, and Abu Yaala did not mention "grant him blessing." Its isnad is daif because of Asim bin Hilal, who is al-Bariqi. Ibn Main deemed him daif, Nasai said, "He is not strong," Ibn Hibban said, "He was among those who transposed isnads through misapprehension," Ibn Adi said, "Most of what he narrates is not corroborated by the trustworthy narrators," and Ibn Hajar said about him, "There is some laxity in him." Others were lenient with him, so Abu Hatim said, "Righteous, a shaykh whose position is truthful," and Abu Dawud said, "There is no harm in him." Haythami mentioned it in Majma (33/3) and said, "In it is Asim bin Hilal, whom Abu Hatim deemed trustworthy while others deemed him daif."On this subject there is also a report from Harith as a raised report, with the wording, "O Allah, forgive our living and our dead, set right the relations among us, and unite our hearts. O Allah, this is Your servant so-and-so son of so-and-so. We know nothing of him but good, and You know him better than we do, so forgive us and forgive him." I said to him, being the youngest of the group, "But what if I do not know good of him?" He said, "Then say nothing but what you know." Tabarani narrated it in al-Kabir and al-Awsat, Majma Bahrayn (1288), and in it is Layth bin Abu Salim, whose memory became confused in his later years, and Haythami attributed the defect to him in Majma (33/3).