It is narrated from Sa'id bin al-Musayyib (may Allah have mercy on him): When death approached an eminent Companion from the Ansar (may Allah be pleased with him), he asked his family: "Who is present in the house?" They said: "Your family, your brothers (in faith) and your companions." He said: "Lift me up and sit me up." So his son propped him up against his chest, and he opened his eyes and greeted those present with salam. The people returned his greeting and spoke good words about him. Then he said: "I am going to narrate to you a hadith which, since I heard it from the Messenger of Allah (peace and blessings be upon him), I have not narrated to anyone until today, seeking only reward, and today too I narrate it to you only for the sake of reward. I heard the Messenger of Allah (peace and blessings be upon him) say: 'Whoever performs ablution in his house and does it well, then sets out for the mosque and prays with the congregation of the Muslims, he does not lift his right foot except that Allah Almighty records a good deed for him because of it, and he does not put down his left foot except that Allah Almighty wipes away a sin from him because of it, until he reaches the mosque, whether (the way to the mosque) is near or far. Then, when he finishes praying behind the imam, he returns in a state in which Allah Almighty has forgiven him. If he catches part of the prayer and misses part of it, and then completes (after the imam's salam) the part he missed, he too has the same reward; and if he arrives when the prayer has already been performed, and then completes his prayer with its bowing and prostrations, the same applies to him.'"
All the narrators of this chain are thiqat (trustworthy).
I say: Imam Abu Dawud mentioned it in his Sunan in abridged form through the narration of Muhammad bin Mu'adh bin Abbad al-Anbari from Abu Awanah.
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب المساجد / 986
Hadith Gradingمحدثین:رجاله ثقات
Hadith Takhrij«هذا الإسناد رجاله ثقات» «أخرجه سنن أبي داود برقم: 563، وأخرجه فتح الباري برقم: 610»