The Prophet ﷺ used to pray voluntary prayers on his mount in whatever direction it was facing as he traveled from Mecca to Medina. Then Ibn Umar recited the verse, "To Allah belong the East and the West" [Baqarah 2:115], and said, "It was concerning this that this verse was revealed."
حدثنا عبد بن حميد أخبرنا يزيد بن هارون أخبرنا عبد الملك بن أبي سليمان قال سمعت سعيد بن جبير يحدث
كان النبي ﷺ يصلي على راحلته تطوعا أينما توجهت به وهو جاء من مكة إلى المدينة ثم قرأ ابن عمر هذه الآية {ولله المشرق والمغرب} الآية فقال ابن عمر ففي هذا أنزلت هذه الآية
Muslim also narrated it in the Book of the Traveler's Prayer, Chapter on the Permissibility of Offering the Voluntary Prayer While Riding During Travel, Wherever One Faces, hadith no. 700, from the hadith of Abdul-Malik with the same wording. The report from Qatada is daif from him, since Saeed bin Abu Aruba used an ambiguous transmission form (anana). The report from Mujahid has a hasan chain.