Sahih Muslim, Book 11, Hadith 95 (Muslim 2195)

It is narrated on the authority of 'Amir Ibn Rabi'a (may Allah be pleased with him) that the Prophet (ﷺ) said:

Whenever you see a funeral procession, stand up for that until it moves away or is lowered on the ground.