Sahih Muslim , Hadith 702

Anas b. Sirin reported: We met Anas b. Malik as he came to Syria at a place known as 'Ain-al-Tamar and saw him observing prayer on the back of his donkey with his face turned in that direction. (Hammam one of the narrators) pointed towards the left of Qibla, so I said to him: I find you observing prayer towards the side other than that of Qibla. Upon this he said: Had I not seen the Messenger of Allah doing like this, I would not have done so at all.

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

sunnah.com