Yazid bin Thabit reported,

We went out with the Prophet ﷺ, and when he came to al-Baqi, he saw a fresh grave and asked about it.The people said, "It is so-and-so, the woman."He recognized her and said, "Why did you not inform me about her?"They said, "You were taking your midday rest while fasting, and we did not want to disturb you."He said, "Do not do that. I do not want anyone among you to die while I am among you without your informing me, for my prayer over him is a mercy for him."Then he went to the grave, and we lined up in rows behind him, and he pronounced four takbirs over her.

Azami 3705

Sahih

عن يزيد بن ثابت، وكان أكبر من زيد، قال

خرجنا مع النبي ﷺ فلما ورد البقيع فإذا هو بقبر جديد فسأل عنه فقالوا: فلانة، قال: فعرفها وقال: ألا آذنتموني بها قالوا: كنت قائلا صائما، فكرهنا أن نؤذيك، قال: فلا تفعلوا لا أعرف ما مات منكم ميت ما كنت بين أظهر كم إلا آذنتموني به، فإن صلاتي عليه له رحمة ثم أتى القبر، فصففنا خلفه، فكبر عليه أربعا.

الأعظمي 3705صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Prayer over the deceased
Section
Four takbirs over the deceased
Numbering
Jami al-Kamil 3705 (2nd edition)
Azami 3705