This is a basic element of funeral prayer according to the consensus of juristic opinion. The Prophet, peace be upon him, said: “When you offer a funeral prayer for a deceased person, pray sincerely for him to Allah.” This is reported by Abu Daw’ud, Al-Baihaqi and Ibn Hibban, who said it is a sound hadith.
For this purpose any supplication, even a brief one, may be used. It is recommended, however, to use one of the following supplications reported from the Prophet, peace be upon him:
1. Abu Hurairah said: The Prophet, peace be upon him, prayed in one of the funeral prayers: Allahumma anta Rubbuha wa ant khalaqtaha wa anta razaqtaha wa ant hadaytaha lil lslam wa anta qabadata ruha-ha wa anta alamu bisirriha wa ‘alaniyatiha. Ji’nashuf’ala-hafaghfir laha zanbaha “Oh Allah ! You are her Sustainer, You are her Creator, You provided her with sustenance, guided her to Islam, caused her to die, and You best know her secret and public life. We plead to You on her behalf to forgive her sins.”
2. Wa’ilah ibn al-Asqa reported: “The Prophet, peace be upon him, led us in a funeral prayer for a man from among the Muslims. I heard him saying: Allahumma inna fulana ibna fulan fi zhimatika wa habla jawaraka, fa-qihu min fitnatal qabri wa azhabin nar wa anta ahlal wafa’ wal haq, allahumma faghfirlahu war-rahmhufa innaka antal ghafurur Raheem. ‘O Allah! So-and-so, son of so-and-so, is under Your protection and mercy, so protect him from the trial of the grave and the torture of Hell Fire. You are the guardian of the truthful and the faithful. OAllah! Forgive him and be merciful to him, as You are the Most Merciful, Most Forgiving’.” Narrated by Ahmad and Abu Daw’ud.
3. ‘Awf ibn Malik reported: “I heard the Prophet, peace be upon him, while offering a funeral prayer, say: Allahumma-ghfir lahu war-rhamhu wa’fu anhu wa ‘afahu wa akrim nuzulahu wa wassi’ mudkhalahu waghsilhu bi-ma’ ind wa thalj wa barad wa naqi minal khataya kama yunaqi athaubu danis minad danas wa abdilhu daran khairan min darihi wa ahlan khairan min ahlihi wa zaujan khairan min zaujihi wa qih fitnatal qabr wa azhaban nar. ‘O Allah! Forgive him, have mercy on him, pardon him, heal him, be generous to him, cause his entrance to be wide and comfortable, wash him with the most pure and clean water, and purify him from sins as a white garment is washed clean of dirt. Give him in exchange a home better than his home (on earth) and a family better than his family, and a wife better than his wife, and protect him from the trial of the grave and the torture of Hell Fire’.” This is narrated by Muslim.
4. It is reported from Abu Hurairah that the Prophet, peace be upon him, offered a funeral prayer and said: Allahummaghfir lihayatina wa mayatina wa saghirina wa kahirina wa zhakirina wa unthana. Allahumma man ahyatahu minna fa-ahyahu ‘alal Islam wa man tawafthu minna fa-tawafthu ‘ala iman. Allahumma la tahrimna ajrahu wa la tudalana ba’dahu. “O Allah! Forgive our living, our dead, our young, our old, our males and our females, those of us who are present, and those who are absent. O Allah! Whomsoever among us You keep to live, make him to live in Islam, and whomsoever You cause to die, let him die in faith. O Allah! Do not deprive us of our reward for (supplicating for) him, and cause us not to go astray after him.” This is narrated by Ahmad and the other Sunan books. (Authentic canonical collections of hadith)
If the deceased is a child, then it is desirable to pray: Allahumma ‘ij’alhu lana salafan wa zhukhran. “O Allah! Make him our forerunner and make him (a means of) reward for us and a treasure.” Bukhari and Al-Baihaqi report it from Al-Hasan. Nawawi said: “If the deceased is a child, a boy or a girl, one should say what is reported in the hadith, namely, “O Allah! Forgive our living, our dead…” and add the words: Allahumma ‘ij’alhu faratan li-abwaihi wa salafan wa zhukhran wa izatan waÂ i’tibaran wa shafi’an wa thaqil bihi mawazlnahumma wa afrlghas sabra ‘ala qulubihima wa la taftinhumma ba’dahu wa la tuharim-humma ajrahu. “O Allah, make him (or her) for hisparents a forerunner, a treasure and an admonition, an honor, an intercessor, and cause him (or her) to make their scales of good deeds heavier (on the Day of Judgement). O Allah! Grant them patience, and O Allah! Do not put them to trial after him (or her) nor deprive them of his (or her) reward.”