Abu Hurairah reported,

The Prophet ﷺ said, "Whoever follows the funeral procession of a Muslim out of faith and hoping for reward, then prays over the deceased and waits until the body is placed in the grave, will receive two qirats of reward, each one like the mountain of Uhud. And whoever prays over the deceased and then returns will receive one qirat."

Nasai 5035

Sahih

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

عن أبي هريرة

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

النسائي 5035صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Faith and its laws
Chapter
Attending funerals
Numbering
Darussalam 5035
Nasai 5035