Zayd bin Thabit reported,

They were sitting with the Prophet ﷺ when a funeral procession came into view. The Messenger of Allah ﷺ stood up, and those with him stood as well, and they remained standing until it had passed.

Azami 3657

Sahih

عن زيد بن ثابت

أنهم كانوا جلوسا مع النبي ﷺ فطلعت جنازة، فقام رسول الله ﷺ، وقام من معه، فلم يزالوا قياما حتى نفذت.

الأعظمي 3657صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Deceased, carrying the funeral bier, and standing for it
Section
Standing for the funeral
Numbering
Jami al-Kamil 3657 (2nd edition)
Azami 3657