It is narrated from Sayyiduna Abu Qatadah (may Allah be pleased with him) that he saw the Messenger of Allah (peace and blessings be upon him) leading a funeral prayer. He says: I heard him (peace and blessings be upon him) saying: 'Allahummaghfir li-hayyina wa mayyitina, wa shahidina wa gha'ibina, wa saghirina wa kabirina, wa dhakarina wa unthana' (O Allah! Forgive our living and our dead, and forgive those of us who are present and those who are absent, our young and our old, and our men and our women). Abu Salamah also narrated this and added these words: 'Allahumma man ahyaytahu minna fa-ahyihi ala al-Islam, wa man tawaffaytahu minna fa-tawaffahu ala al-iman' (O Allah! Whomever of us You keep alive, keep him alive upon Islam, and whomever You cause to die, grant him death upon faith).
Imam Abu Ya'la, Imam Ahmad bin Hanbal and Imam al-Bayhaqi in "al-Kubra" recorded this hadith with a sahih (authentic) chain; Imam Ibn Majah also recorded it from the hadith of Sayyiduna Abu Hurayrah (may Allah be pleased with him), while its origin is in Sahih Muslim and elsewhere from the hadith of Sayyiduna Awf bin Malik (may Allah be pleased with him). Imam al-Bayhaqi says: "Many hadith are reported from the Prophet (peace and blessings be upon him), and then from Sayyiduna Umar, Sayyiduna Ali, Sayyiduna Ibn Umar, Sayyiduna Abu Hurayrah (may Allah be pleased with them) and others, concerning supplication in the funeral prayer, and no particular supplication is (obligatorily) fixed for the funeral prayer."
Hadith Takhrij«رواه أبو يعلى وأحمد بن حنبل والبيهقي في الكبرى بسند صحيح» «أخرجه سنن أبي داود برقم: 3201، وأخرجه صحيح ابن حبان برقم: 3070، وأخرجه البحر الزخار المعروف بمسند البزار 10 - 18 برقم: 8556، وأخرجه شرح السنة برقم: 1494، وأخرجه السنن الصغير للبيهقي برقم: 1086، وأخرجه مسند أحمد برقم: 22048، وأخرجه السنن الكبرى للنسائي برقم: 11151، وأخرجه شرح مشكل الآثار برقم: 966»