The Messenger of Allah ﷺ performed the funeral prayer over a deceased person and said, "O Allah, forgive our living and our dead, our young and our old, our males and our females, those of us who are present and those who are absent. O Allah, whomever among us You keep alive, keep him alive upon faith, and whomever among us You take in death, take him in death upon Islam. O Allah, do not deprive us of his reward, and do not lead us astray after him."
حدثنا موسى بن مروان الرقي حدثنا شعيب يعني ابن إسحق عن الأوزاعي عن يحيى بن أبي كثير عن أبي سلمة
صلى رسول الله ﷺ على جنازة فقال اللهم اغفر لحينا وميتنا وصغيرنا وكبيرنا وذكرنا وأنثانا وشاهدنا وغائبنا اللهم من أحييته منا فأحيه على الإيمان ومن توفيته منا فتوفه على الإسلام اللهم لا تحرمنا أجره ولا تضلنا بعده
[Its isnad is hasan]. Tirmidhi narrated it in the Book of Funerals, Chapter on What Is Said in the Prayer for the Deceased, hadith no. 1024, from the hadith of Uzai with this wording, with additional remarks. Ibn Hibban graded it sahih, hadith no. 757, as did Hakim, 1/358, saying it meets the criteria of the two Shaykhs, and Dhahabi agreed with him. The hadith has corroborating narrations.Yahya bin Abu Kathir stated explicitly that he heard it directly.