Riyad as-Salihin (The Meadows of the Righteous)
by Imam Nawawi
153. Chapter: On the permission to weep for someone who has died without wailing
Wailing is forbidden and will be dealt later. There are many hadiths which say that weeping is forbidden and that the dead person is tortured by his family's weeping. They are subject to interpretation. The weeping which is forbidden is that in which there is lamentation or wailing. There are many hadiths which indicate that weeping without that is permitted.
925. Ibn 'Umar reported that the Messenger of Allah, may Allah bless him and grant him peace, visited Sa'd ibn 'Ubada with 'Abdu'r-Rahman ibn 'Awf, Sa'd ibn Abi Waqqas and 'Abdullah ibn Mas'ud. The Messenger of Allah wept. When the people saw the Prophet weeping, they wept as well. He said, "Listen, Allah does not punish people for the tears of their eyes nor for the sorrow of their hearts, but he punishes or shows mercy on account of this," and he pointed to his tongue. [Agreed upon]
926. Usama ibn Zayd reported that the grandson of the Messenger of Allah, may Allah bless him and grant him peace, was brought to him near to death. The Prophet's eyes were flowing with tears and Sa'd said, 'Messenger of Allah, what is this?' He said, 'This is an aspect of mercy which Allah Almighty has put in the hearts of His slaves. Allah is merciful to His slaves who are merciful.'" [Agreed upon]
927. Anas reported that the Messenger of Allah, may Allah bless him and grant him peace, visited his son Ibrahim while he was breathing his last. The eyes of the Messenger of Allah, may Allah bless him and grant him peace, began to flow with tears and 'Abdu'r-Rahman ibn 'Awf said to him, "Even you, Messenger of Allah!" He said, "O Ibn 'Awf, it is an aspect of mercy." then more tears followed and the Prophet said, "The eye weeps and the heart grieves. We say nothing except what pleases our Lord. O Ibrahim, we are grieved at your departure." [al-Bukhari]