حَدَّثَنَا سُوَيْدُ بْنُ سَعِيدٍ، حَدَّثَنَا عَلِيُّ بْنُ مُسْهِرٍ، عَنْ مُحَمَّدِ بْنِ إِسْحَاقَ، عَنْ مُحَمَّدِ بْنِ إِبْرَاهِيمَ، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ، قَالَ كَانَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ إِذَا صَلَّى عَلَى جِنَازَةٍ يَقُولُ ‏"‏ اللَّهُمَّ اغْفِرْ لِحَيِّنَا وَمَيِّتِنَا وَشَاهِدِنَا وَغَائِبِنَا وَصَغِيرِنَا وَكَبِيرِنَا وَذَكَرِنَا وَأُنْثَانَا اللَّهُمَّ مَنْ أَحْيَيْتَهُ مِنَّا فَأَحْيِهِ عَلَى الإِسْلاَمِ وَمَنْ تَوَفَّيْتَهُ مِنَّا فَتَوَفَّهُ عَلَى الإِيمَانِ اللَّهُمَّ لاَ تَحْرِمْنَا أَجْرَهُ وَلاَ تُضِلَّنَا بَعْدَهُ ‏"‏ ‏.‏

It wasnarrated that Abu Hurairah said: “When the Messenger of Allah(PBUH)offered the funeral prayer he would say: ‘Allahummaghfirlihayyinawa mayyitina, wa shahidina wa gha’ibina, wa saghirina wakabirina,wa dhakarina wa unthana. Allahumma man ahyaitahu minnafaahyihi‘alal-Islam, wa man tawaffaytahu minna fa tawaffahu ‘alal-iman.Allahumma la tahrimna ajrahu wa la tudillana ba’dah. [O Allah,forgive our living and our dead, those who are present and those whoare absent, our young and our old, our males and our females. OAllah,whomever of us You cause to live, let him live in Islam, andwhomeverof us You cause to die, let him die in (a state of) faith. OAllah, donot deprive us of his reward, and do not let us go astrayafterhim].’” Translation Not Available

Book Ref: Sunan Ibn Majah Book 6 Hadith 1498
Web Ref:  Sunan Ibn Majah Vol 1 Book 6 Hadith 1498