The Messenger of Allah ﷺ sent me on an errand. I (having done the business assigned to me came back and) joined him as he was going (on a ride). Qutaiba said that he was saying prayer while he rode. I greeted him. He gestured to me. When he completed the prayer. he called me and said: You greeted me just now while I was engaged in prayer. (Qutaiba said): His (Prophet's face) was towards the east, as he was praying. (Using translation from Muslim 540a)
أَنَّهُ قَالَ إِنَّ رَسُولَ اللهِ ﷺ بَعَثَنِي لِحَاجَةٍ ثُمَّ أَدْرَكْتُهُ وَهُوَ يُصَلِّي فَسَلَّمْتُ عَلَيْهِ فَأَشَارَ إِلَيَّ فَلَمَّا فَرَغَ دَعَانِي فَقَالَ إِنَّكَ سَلَّمْتَ آنِفًا وَأَنَا أُصَلِّي وَهُوَ مُوَجَّهٌ حِينَئِذٍ قِبَلَ الْمَشْرِقِ