Sunan an-Nasa'i, Book 21, Hadith 181 (Nasa'i 2003)

It was narrated that Abu Sa'eed said:

"The Messenger of Allah said: 'If you see a funeral, then stand up, and whoever follows it, then let him not sit down until (the body) is placed in the grave."'