Narrated Amir bin Rabia: The Prophet, peace be upon him, said, “If anyone of you sees a funeral proces-sion and he is not going alongwith it, then he should stand. (He should) remain standing till he gets behind it, or it leaves him behind, or the coffin is put down before it goes ahead of him.”
[2: 395- O.B. Sahih Al-Bukhari]
Narrated Sa’id Al-Maqburi that his father said: While we were accompanying a funeral procession: Abu Hurairah got hold of the hand of Marwan and they sat down before the coffin was put down. Then Abu Sa’id came and took hold of Marwan’s hand and said, “Get up. By Allah, no doubt this (i.e. Abu Hurairah) knows that the Prophet forbade us to do that.” Abu Hurairah said, “He (Abu Sa’id) has spoken the truth.”
[2: 396- O.B. Sahih Al-Bukhari)