Jami` at-Tirmidhi, Book 47, Hadith 10 (Tirmidhi 3042)

Narrated Ibn 'Umar:

"The Messenger of Allah (ﷺ) would perform voluntary Salat upon his mount facing whichever direction he was headed, while he was coming from Makkah to Al-Madinah." Then Ibn 'Umar recited: To Allah belong both the east and the west. (2:115)" And Ibn 'Umar said: "It was about this that the Ayah was revealed." This Hadith is Hasan Sahih. It has been reported from Qatadah that he said about this Ayah: To Allah belong both the east and the west, so wherever you turn, there is the Face of Allah. : So turn your face in the direction of Al-Masjid Al-Haram. Meaning: facing it." And it has been reported that Mujãhid said about this Ayah: "So wherever you turn, there is the Face of Allah": "So there is the direction of Allah."