We met Anas when he arrived from Syria, receiving him at Ayn al-Tamr. I saw him praying on a donkey, with his face turned toward this side, meaning to the left of the qiblah.I said to him, "I saw you praying in a direction other than the qiblah."He replied, "Had I not seen the Messenger of Allah ﷺ do it, I would not have done it."
استقبلنا أنسا حين قدم من الشام، فتلقيناه بعين التمر، فرأيته يصلي على حمار ووجهه من ذا الجانب يعني عن يسار القبلة- فقلت: رأيتك تصلي لغير القبلة، فقال: لولا أني رأيت رسول الله ﷺ فعله لم أفعله.
Bukhari related it in "Shortening the Prayer" (1100), and Muslim in "The Prayer of Travelers" (702), both from the hadith of Hammam, who said, "Anas bin Sirin narrated to us," and then he mentioned it. The wording given here is Bukhari's. Muslim's wording is the same, except that he said in it, "When he arrived in Sham."Nawawi said, "This is how it appears in all copies of Muslim, and Qadi Iyad likewise transmitted it this way from all the narrations of Sahih Muslim. He said, it has been suggested that this is a mistake, and that the correct wording is, 'he arrived from Sham,' as it appears in Sahih Bukhari, because they had gone out from Basra to meet him when he arrived from Sham. But he also said that Muslim's narration is sahih, and its meaning is that we met him upon his return, when he arrived in Sham, and the mention of his return was simply omitted because it was already known." End of Nawawi's remarks.This narration does not clarify how Anas performed his prayer. Malik, however, mentioned it in "Shortening the Prayer" (26), from Yahya bin Saeed, who said, "I saw Anas bin Malik on a journey, praying on a donkey, facing a direction other than the qibla, bowing and prostrating by gesture, without placing his face on anything."