Saeed bin Musayab reported,

A man from the Ansar was on his deathbed, and he said, "I am about to tell you a hadith that I am sharing with you only seeking reward from Allah. I heard the Messenger of Allah ﷺ say, 'When one of you performs ablution and does it well, then sets out for the prayer, he does not lift his right foot without Allah عز وجل recording a good deed for him, and he does not place his left foot down without Allah عز وجل erasing a sin from him. So let one of you come from near or from far. If he reaches the mosque and prays with the congregation, he is forgiven. If he reaches the mosque after they have prayed part of the prayer with some still remaining, and he prays what he catches and completes what is left, it is the same. And if he reaches the mosque after they have already prayed and he completes the prayer on his own, it is the same.'"

Abu Dawud 563

Hasan

حدثنا محمد بن معاذ بن عباد العنبري حدثنا أبو عوانة عن يعلى بن عطاء عن معبد بن هرمز

عن سعيد بن المسيب قال

حضر رجلا من الأنصار الموت فقال إني محدثكم حديثا ما أحدثكموه إلا احتسابا سمعت رسول الله ﷺ يقول إذا توضأ أحدكم فأحسن الوضوء ثم خرج إلى الصلاة لم يرفع قدمه اليمنى إلا كتب الله عز وجل له حسنة ولم يضع قدمه اليسرى إلا حط الله عز وجل عنه سيئة فليقرب أحدكم أو ليبعد فإن أتى المسجد فصلى في جماعة غفر له فإن أتى المسجد وقد صلوا بعضا وبقي بعض صلى ما أدرك وأتم ما بقي كان كذلك فإن أتى المسجد وقد صلوا فأتم الصلاة كان كذلك

أبو داود 563حسن
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Prayer
Chapter
Guidance in walking to prayer
Numbering
Darussalam 563
Abu Dawud 563