Sunan an-Nasa'i, Book 21, Hadith 100 (Nasa'i 1922)

It was narrated that Abu Sa'eed said:

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