Sahih al-Bukhari #4490 · Prophetic Commentary on the Qur'an (Tafseer of the Prophet (pbuh))

Sahih al-BukhariIbn Umar
Sahih al-Bukhari · Book 65 · Prophetic Commentary on the Qur'an (Tafseer of the Prophet (pbuh))
Sahih al-Bukhari · كتاب 65 · كتاب التفسير
While some people were offering morning prayer at Quba' a man came to them and said, "A Qur'anic Order has been revealed to Allah's Messenger (ﷺ) tonight that he should face the Ka'ba at Mecca (in prayer), so you too should turn your faces towards it." At that moment their faces were towards Sham (i.e. Jerusalem) (and on hearing that) they turned towards the Ka'ba (at Mecca)
حَدَّثَنَا خَالِدُ بْنُ مَخْلَدٍ، حَدَّثَنَا سُلَيْمَانُ، حَدَّثَنِي عَبْدُ اللَّهِ بْنُ دِينَارٍ، عَنِ ابْنِ عُمَرَ ـ رضى الله
عنهما ـ بَيْنَمَا النَّاسُ فِي الصُّبْحِ بِقُبَاءٍ جَاءَهُمْ رَجُلٌ فَقَالَ إِنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَدْ أُنْزِلَ عَلَيْهِ اللَّيْلَةَ قُرْآنٌ، وَأُمِرَ أَنْ يَسْتَقْبِلَ الْكَعْبَةَ أَلاَ فَاسْتَقْبِلُوهَا‏.‏ وَكَانَ وَجْهُ النَّاسِ إِلَى الشَّأْمِ فَاسْتَدَارُوا بِوُجُوهِهِمْ إِلَى الْكَعْبَةِ‏.‏
Reference : Sahih al-Bukhari 4490In-book reference : Book 65, Hadith 17