Sahih Muslim 526 a
Ibn 'Umar reported:
As the people were praying at Quba' a man came to them and said: It has been revealed to file Messenger of Allah (ﷺ) during the night and he has been directed to turn towards the Ka'ba. So turn towards it. Their faces were towards Syria and they turned round towards Ka'ba.
حَدَّثَنَا شَيْبَانُ بْنُ فَرُّوخَ، حَدَّثَنَا عَبْدُ الْعَزِيزِ بْنُ مُسْلِمٍ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ دِينَارٍ، عَنِ ابْنِ عُمَرَ، ح وَحَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، - وَاللَّفْظُ لَهُ - عَنْ مَالِكِ بْنِ أَنَسٍ، عَنْ عَبْدِ اللَّهِ بْنِ دِينَارٍ، عَنِ ابْنِ عُمَرَ، قَالَ بَيْنَمَا النَّاسُ فِي صَلاَةِ الصُّبْحِ بِقُبَاءٍ إِذْ جَاءَهُمْ آتٍ فَقَالَ إِنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَدْ أُنْزِلَ عَلَيْهِ اللَّيْلَةَ ‏.‏ وَقَدْ أُمِرَ أَنْ يَسْتَقْبِلَ الْكَعْبَةَ فَاسْتَقْبِلُوهَا ‏.‏ وَكَانَتْ وُجُوهُهُمْ إِلَى الشَّامِ فَاسْتَدَارُوا إِلَى الْكَعْبَةِ ‏.‏