156 – The Prophet ﷺ used to teach his Companions that when they visited the graves one of them should say: “Peace be upon you, O abode of a believing people! If Allah wills, we shall soon join you. May Allah have mercy on those of us who have gone ahead and those who come later. We ask Allah for well-being for us and for you. O Allah, do not deprive us of their reward and do not subject us to trial after them.”¹
157 – It is also reported from the Prophet ﷺ that he said: “Whenever a man passes by the grave of someone he knew in this world and greets him, Allah returns his soul to him so that he may return the greeting.”²
158 – The prescribed manner for a Muslim to visit graves is to offer greetings to the deceased and supplicate for him, just as the very purpose of the funeral prayer is to invoke mercy for him.
159 – For this reason Allah forbade His Prophet ﷺ to perform either of these two acts for the hypocrites.
(1) Muslim, no. 975/104, records on the authority of Buraydah that the Messenger of Allah used to teach them, when they went out to the cemeteries, to say: “al-salam ‘alaykum ahl al-diyar min al-mu’minin wa-l-muslimin, wa inna in sha Allah lahiqun, as’alu Allah lana wa lakum al-‘afiyah” (Peace be upon you, inhabitants of these dwellings, believers and Muslims. God willing, we shall soon join you. I ask Allah for well-being for us and for you). Muslim also transmits no. 974/102 from Aishah with the wording: “al-salam ‘ala ahl al-diyar min al-mu’minin wa-l-muslimin, yarhamu Allah al-mustaqdimina minna wa-l-musta’khirin, wa inna in sha Allah bikum lahiqun” (Peace be upon the inhabitants of the dwellings, believers and Muslims. May Allah have mercy on those of us who have gone on and those who remain; God willing, we will join you). The phrase “Allahumma la tahrimna ajrahum wa la taftinna ba’dahum” (O Allah, do not deprive us of their reward and do not test us after them) occurs in the supplication recited during the funeral prayer, in the hadith of Abu Hurayrah reported by Ibn Majah, no. 1498.
(2) Al-‘Iraqi states in Takhrij al-Ihya’ (4/522): “Ibn Abd al-Barr related it in al-Tamhid and al-Istidhkar with a sound chain from Ibn Abbas, and it was declared authentic by Abd al-Haqq.”