(32) باب قَوْلِ النَّبِيِّ صلى الله عليه وسلم: «يُعَذَّبُ الْمَيِّتُ بِبَعْضِ بُكَاءِ أَهْلِهِ عَلَيْهِ» إِذَا كَانَ النَّوْحُ مِنْ سُنَّتِهِ
Narrated Usama bin Zaid:
The daughter of the Prophet (p.b.u.h) sent (a messenger) to the Prophet (ﷺ) requesting him to come as her child was dying (or was gasping), but the Prophet (ﷺ) returned the messenger and told him to convey his greeting to her and say: "Whatever Allah takes is for Him and whatever He gives, is for Him, and everything with Him has a limited fixed term (in this world) and so she should be patient and hope for Allah's reward." She again sent for him, swearing that he should come. The Prophet (ﷺ) got up, and so did Sa`d bin 'Ubada, Mu`adh bin Jabal, Ubai bin Ka`b, Zaid bin Thabit and some other men. The child was brought to Allah's Messenger (ﷺ) while his breath was disturbed in his chest (the sub-narrator thinks that Usama added: ) as if it was a leather water-skin. On that the eyes of the Prophet (p.b.u.h) started shedding tears. Sa`d said, "O Allah's Messenger (ﷺ)! What is this?" He replied, "It is mercy which Allah has lodged in the hearts of His slaves, and Allah is merciful only to those of His slaves who are merciful (to others).
Reference: Sahih al-Bukhari 1284
In-book reference: Book 23, Hadith 45
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 2, Book 23, Hadith 373