It is narrated on the authority of 'Amir ibn Rabi'a (may Allah be pleased with him) that the Prophet (ﷺ) said
Should any one of you come across a funeral procession, and if he does not intend to accompany it, he must stand up until it passes by him or is placed upon the ground before it passes him.