When the Messenger of Allah ﷺ prayed over a dead person, he said: O Allah, forgive those of us who are living and those of us who are dead, those of us who are present and those of us who are absent, our young and our old, our male and our female. O Allah, to whomsoever of us Thou givest life grant him life as a believer, and whomsoever of us Thou takest in death take him in death as a follower of Islam. O Allah, do not withhold from us the reward (of faith) and do not lead us astray after his death. (Using translation from Abū Dāʾūd 3201)
سَأَلْتُ عَائِشَةَ كَيْفَ كَانَ صَلَاةُ رَسُولِ اللهِ ﷺ عَلَى الْمَيِّتِ؟ قَالَتْ كَانَ يَقُولُ «اللهُمَّ اغْفِرْ لِحَيِّنَا وَمَيِّتِنَا وَلِصَغِيرِنَا وَكَبِيرِنَا وَذَكَرِنَا وَأُنْثَانَا وَلِغَائِبِنَا وَشَاهِدِنَا اللهُمَّ مَنْ أَحْيَيْتَهُ مِنَّا فَأَحْيِهِ عَلَى الْإِسْلَامِ وَمَنْ تَوَفَّيْتَهُ مِنَّا فَتَوَفَّهُ عَلَى الْإِيمَانِ»