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.'"
حدثنا محمد بن معاذ بن عباد العنبري حدثنا أبو عوانة عن يعلى بن عطاء عن معبد بن هرمز
حضر رجلا من الأنصار الموت فقال إني محدثكم حديثا ما أحدثكموه إلا احتسابا سمعت رسول الله ﷺ يقول إذا توضأ أحدكم فأحسن الوضوء ثم خرج إلى الصلاة لم يرفع قدمه اليمنى إلا كتب الله عز وجل له حسنة ولم يضع قدمه اليسرى إلا حط الله عز وجل عنه سيئة فليقرب أحدكم أو ليبعد فإن أتى المسجد فصلى في جماعة غفر له فإن أتى المسجد وقد صلوا بعضا وبقي بعض صلى ما أدرك وأتم ما بقي كان كذلك فإن أتى المسجد وقد صلوا فأتم الصلاة كان كذلك