Sahih Muslim , Book 6, Hadith 43 (In-Book)

Ibn 'Umar reported that the Messenger of Allah used to say prayer on his camel while coming from Mecca to Medina, in whatever direction his face had turned; and its was (in this context) that this verse was revealed: " So whether you turn thither is Allah's face" (ii. 115).

وَحَدَّثَنِي عُبَيْدُ اللَّهِ بْنُ عُمَرَ الْقَوَارِيرِيُّ، حَدَّثَنَا يَحْيَى بْنُ سَعِيدٍ، عَنْ عَبْدِ الْمَلِكِ بْنِ أَبِي سُلَيْمَانَ، قَالَ حَدَّثَنَا سَعِيدُ بْنُ جُبَيْرٍ، عَنِ ابْنِ عُمَرَ، قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يُصَلِّي وَهُوَ مُقْبِلٌ مِنْ مَكَّةَ إِلَى الْمَدِينَةِ عَلَى رَاحِلَتِهِ حَيْثُ كَانَ وَجْهُهُ - قَالَ - وَفِيهِ نَزَلَتْ ‏{‏ فَأَيْنَمَا تُوَلُّوا فَثَمَّ وَجْهُ اللَّهِ‏}‏

sunnah.com