Yazid bin Thabit reported,

We went out with the Prophet ﷺ, and when he arrived at al-Baqi he came upon a fresh grave. He asked about it, and the people said, "It is so-and-so, a woman."He recognized her and said, "Why did you not inform me of her death?"They replied, "You were taking your midday rest and were fasting, so we disliked disturbing you."He said, "Do not do that. Let me not learn that any of you has died while I am among you without your informing me of it, for my prayer over him is a mercy for him."Then he went to the grave, and we formed rows behind him, and he pronounced four takbirs over her.

Azami 3733

Sahih

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

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

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