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."
English reference: Vol. 5, Book 44, Hadith 2958
Arabic reference: Book 47, Hadith 3217
Read hadith from the major collections in the app, with prayer times and a Qibla compass. Free.