The Messenger of Allah ﷺ said, "Whoever follows a funeral procession and prays over the deceased, then leaves, will receive one qirat of reward. And whoever follows it, prays over the deceased, and remains until the burial is completed will receive two qirats of reward, each of them greater than Mount Uhud."
أخبرنا الحسن بن قزعة قال حدثنا مسلمة بن علقمة قال أنبأنا داود عن عامر
قال رسول الله ﷺ من تبع جنازة فصلى عليها ثم انصرف فله قيراط من الأجر ومن تبعها فصلى عليها ثم قعد حتى يفرغ من دفنها فله قيراطان من الأجر كل واحد منهما أعظم من أحد