“We went out with the Messenger of Allah (ﷺ) for a funeral, and he sat facing the Qiblah (prayer direction).”
Sunan Ibn Majah Book 6, Hadith 116