The Prophet (ﷺ) said: "Whoever follows the funeral procession of a Muslim out of faith and in the hope of reward, then offers the funeral prayer for him and waits until he is placed in his grave, then he will have two Qirats, each of which is like Mount Uhud. Whoever offers the funeral prayer for him then returns, he will have one Qirat."
Reference: Sunan an-Nasa'i 5032 In-book : Book 47, Hadith 48 English translation : Vol. 6, Book 47, Hadith 5035
Help us gift a modern, ad-free Islamic application for the Muslim Ummah. Your donation will be recorded as Sadaqah Jariyah in your book of deeds, In Sha Allah.