Sunan Ibn Majah, Book 6, Hadith 111 (Ibn Majah 1543)

It was narrated that Abu Hurairah said:

“A funeral has passed by the Prophet (ﷺ) and he stood up and said: ‘Stand up out of recognition of the enormity of death.’”