The Messenger of Allah ﷺ said, "When you see a funeral procession, if you are not walking with it, then stand for it until it passes you or is set down."Ibn Umar would sometimes go ahead of the funeral procession and sit, then when he saw it approaching, he would stand until it was set down. Sometimes it would be hidden from his view.
حدثنا إسماعيل أخبرنا أيوب عن نافع عن ابن عمر
قال رسول الله ﷺ إذا رأيت جنازة فإن لم تك ماشيا معها فقم لها حتى تخلفك أو توضع قال فكان ابن عمر ربما تقدم الجنازة فقعد حتى إذا رآها قد أشرفت قام حتى توضع وربما سترته
No references are available.
Its isnad is sahih. It appeared previously at 15614.