Anas bin Malik reported,

Abu Bakr was leading them in prayer during the illness from which the Messenger of Allah ﷺ passed away. Then on Monday, while they were standing in rows for the prayer, the Messenger of Allah ﷺ drew aside the curtain of the chamber and looked at us while standing, his face like a page of the Quran. Then the Messenger of Allah ﷺ smiled, laughing.We were nearly distracted in our prayer out of joy at the appearance of the Messenger of Allah ﷺ. Abu Bakr stepped back on his heels to join the row, thinking that the Messenger of Allah ﷺ was coming out to pray. But the Messenger of Allah ﷺ gestured to them with his hand to complete their prayer.Then the Messenger of Allah ﷺ went back inside and let down the curtain, and the Messenger of Allah ﷺ passed away that very day.

Azami 2635

Sahih

عن أنس بن مالك قال

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

الأعظمي 2635صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Minor actions do not invalidate the prayer
Section
Stepping backward in prayer
Numbering
Jami al-Kamil 2635 (2nd edition)
Azami 2635