The Prophet (ﷺ) as saying: When you see a funeral, stand up for it till it leaves you behind or it is placed (on the ground).

Sunan Abi Dawud Book 21, Hadith 84