The prayer over the dead, escorting him and being present at his burial, and the dislike for women to follow funeral processions

Riyad as-Salihin (The Meadows of the Righteous)

by Imam Nawawi

155. Chapter: The prayer over the dead, escorting him and being present at his burial, and the dislike for women to follow funeral processions

929. Abu Hurayra reported that the Messenger of Allah, may Allah bless him and grant him peace, said, "Anyone who joins a funeral procession, staying until he has done the prayer, will have one qirat. Anyone who stays until after the burial will have two qirats." It was asked, "What are two qirats?" He said, "Like two huge mountains." [Agreed upon]

930. Abu Hurayra is that the Messenger of Allah, may Allah bless him and grant him peace, said, "Anyone who follows the funeral procession of a Muslim motivated by belief and in expectation of the reward and stays with it until the prayer has been said over him and his burial is over, comes back with the reward of two qirats. Each qirat is the size of Uhud. And whoever prays over him and leaves before he is buried, comes back with one qirat." [al-Bukhari]

931. Umm 'Atiyya said, "We were forbidden to join funeral processions but not rigidly." [Agreed upon]