Jami` at-Tirmidhi, Book 10, Hadith 78 (Tirmidhi 1044)

Amir bin Rabi'ah narrated that:

The Messenger of Allah said: "Whenever you see a funeral (procession), stand up until it goes ahead of you or it is put down."