Anas bin Malik reported,

He was a follower, servant, and companion of the Prophet ﷺ. He reported that Abu Bakr was leading the prayer during the illness in which the Prophet ﷺ passed away. On Monday, while we were standing in rows for prayer, the Prophet ﷺ drew aside the curtain of the chamber and looked at us, standing upright, his face like the page of a mushaf. Then he smiled, laughing. We were nearly overcome with joy at the sight of the Prophet ﷺ. Abu Bakr stepped back on his heels to join the row, thinking the Prophet ﷺ was coming out to lead the prayer. But the Prophet ﷺ gestured to us to complete our prayer, then he let down the curtain. He passed away that same day.

Azami 2237

Sahih

عن أنس بن مالك الأنصاري

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

الأعظمي 2237صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Leadership
Section
Giving precedence to the people of knowledge and virtue
Numbering
Jami al-Kamil 2237 (2nd edition)
Azami 2237