The Ruling of crying and wailing over a Dead Person

Imam Al-Nawawi’s Riyad-us-Saliheen
Chapter 153
The Ruling of crying and wailing over a Dead Person

Wailing is unanimously forbidden (Haram) as will be mentioned later on. There are some Ahadith which forbid us from crying over somebody’s death, and which inform us that the dead will be tormented in their graves as a result of their relatives crying over their death. This prohibition applies only to those cases where crying is accompanied with lamenting and wailing. Weeping without these two is, permissible; and the Ahadith in support of this are many, including the following:

925. Ibn `Umar (May Allah be pleased with them) reported: The Messenger of Allah (sallallaahu ’alayhi wa sallam) visited Sa`d bin `Ubadah during his illness. He was accompanied by `Abdur-Rahman bin `Auf, Sa`d bin Abu Waqqas and `Abdullah bin Mas`ud (May Allah be pleased with them). The Messenger of Allah (sallallaahu ’alayhi wa sallam) began to weep. When his Companions saw this, their tears also started flowing. He (sallallaahu ’alayhi wa sallam) said, “Do you not hear, Allah does not punish for the shedding of tears or the grief of the heart, but punishes or bestows mercy for the utterances of this (and he pointed to his tongue).”
[Al-Bukhari and Muslim].

926. Usamah bin Zaid (May Allah be pleased with him) reported: A grandson (child of the daughter) of the Messenger of Allah (sallallaahu ’alayhi wa sallam) was presented to him while the child was at his last breath. Tears began to flow from the eyes of the Messenger of Allah (sallallaahu ’alayhi wa sallam). Sa`d said to him: “What is this, O Messenger of Allah?’ He (sallallaahu ’alayhi wa sallam) said, “It is mercy which Allah has placed in the hearts of his salves. Allah bestows His Mercy on the merciful among His slaves.”
[Al-Bukhari and Muslim].

927. Anas (May Allah be pleased with him) reported: The Messenger of Allah (sallallaahu ’alayhi wa sallam) came to his son Ibrahim (May Allah be pleased with him) when he was breathing his last. The eyes of the Messenger of Allah (sallallaahu ’alayhi wa sallam) began shedding tears. `Abdur-Rahman bin `Auf  (May Allah be pleased with him) said, “O Messenger of Allah, you too weep?” He (sallallaahu ’alayhi wa sallam) said, “O Ibn `Auf! It is mercy.” Then he began to weep and said, “The eyes are shedding tears and the heart is grieved, and we will not say except what pleases our Rubb. O Ibrahim! Indeed we are grieved by your departure.”
[Al-Bukhari].