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

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.