Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Whoever follows a Muslim's funeral seeking reward, and remains with it until the prayer is performed over the deceased and the burial is completed, will return with two qirats of reward, each qirat like Mount Uhud. Whoever prays over it and returns before the burial will return with one qirat."Ishaq's version states, "out of faith and seeking reward," and says, "If he returns before the body is placed in the grave, he will return with one qirat."

Ahmad 10391

Sahih

حدثنا محمد بن جعفر قال حدثنا عوف وإسحاق يعني ابن يوسف الأزرق قال أخبرنا عوف المعنى عن محمد

عن أبي هريرة

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

أحمد 10391صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abu Hurairah
Numbering
Darussalam 10391
Ahmad 10391