Abdullah bin Umar reported,

The Messenger of Allah ﷺ used to pray on his mount while traveling from Mecca to Medina, facing whatever direction his mount was heading. He said, and concerning this was revealed, "So wherever you turn, there is the face of Allah" [Baqarah 2:115].

Muslim 1612

Sahih

و حدثني عبيد الله بن عمر القواريري حدثنا يحيى بن سعيد عن عبد الملك بن أبي سليمان قال حدثنا سعيد بن جبير

عن ابن عمر قال

كان رسول الله ﷺ يصلي وهو مقبل من مكة إلى المدينة على راحلته حيث كان وجهه قال وفيه نزلت {فأينما تولوا فثم وجه الله}

مسلم 1612صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Travelers' prayer and its shortening
Chapter
Permissibility of praying voluntary prayers on a mount while traveling, whichever direction it faces
Numbering
Darussalam 1612
Muslim 1612