أَخْبَرَنَا قُتَيْبَةُ، قَالَ حَدَّثَنَا اللَّيْثُ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، عَنْ عَامِرِ بْنِ رَبِيعَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ إِذَا رَأَى أَحَدُكُمُ الْجَنَازَةَ فَلَمْ يَكُنْ مَاشِيًا مَعَهَا فَلْيَقُمْ حَتَّى تُخَلِّفَهُ أَوْ تُوضَعَ مِنْ قَبْلِ أَنْ تُخَلِّفَهُ ‏"‏ ‏.‏
Translation
It was narrated from Abu Sa'eed that a funeral passed by the Messenger of Allah and he stood up. (One of the narrators) 'Amr said

"If a funeral passed by the Messenger of Allah he would stand up."