The Messenger of Allah ﷺ said, "When you see a funeral procession, stand up, and whoever follows it should not sit down until it is placed on the ground."
أن رسول الله ﷺ قال: إذا رأيتم الجنازة فقوموا، فمن تبعها فلا يجلس حتى توضع.
Bukhari narrated it in the Book of Funerals (1310), and Muslim in the Book of Funerals (77/959), both from the hadith of Hisham (that is, Ibn Hassan), who said, "Yahya bin Abu Kathir narrated to us, from Abu Salama bin Abdul-Rahman, from Abu Saeed," and he mentioned it.