Sunan an-Nasa'i, Book 21, Hadith 103 (In-Book)

It was narrated form Yazid bin Thabit: That they were sitting with the Messenger of Allah when a funeral appeared. The Messenger of Allah stood up, and those who were with him stood up, until it had passed by.

أَخْبَرَنِي أَيُّوبُ بْنُ مُحَمَّدٍ الْوَزَّانُ، قَالَ حَدَّثَنَا مَرْوَانُ، قَالَ حَدَّثَنَا عُثْمَانُ بْنُ حَكِيمٍ، قَالَ أَخْبَرَنِي خَارِجَةُ بْنُ زَيْدِ بْنِ ثَابِتٍ، عَنْ عَمِّهِ، يَزِيدَ بْنِ ثَابِتٍ أَنَّهُمْ كَانُوا جُلُوسًا مَعَ النَّبِيِّ صلى الله عليه وسلم فَطَلَعَتْ جَنَازَةٌ فَقَامَ رَسُولُ اللَّهِ صلى الله عليه وسلم وَقَامَ مَنْ مَعَهُ فَلَمْ يَزَالُوا قِيَامًا حَتَّى نَفَذَتْ ‏.‏

sunnah.com