كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(2)
Chapter: Changing the qiblah from Al-Quds (Jerusalem) to the Ka`bah
(2)
باب تَحْوِيلِ الْقِبْلَةِ مِنَ الْقُدْسِ إِلَى الْكَعْبَةِ ‏
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.
حَدَّثَنَا شَيْبَانُ بْنُ فَرُّوخَ، حَدَّثَنَا عَبْدُ الْعَزِيزِ بْنُ مُسْلِمٍ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ دِينَارٍ، عَنِ ابْنِ عُمَرَ، ح وَحَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، - وَاللَّفْظُ لَهُ - عَنْ مَالِكِ بْنِ أَنَسٍ، عَنْ عَبْدِ اللَّهِ بْنِ دِينَارٍ، عَنِ ابْنِ عُمَرَ، قَالَ بَيْنَمَا النَّاسُ فِي صَلاَةِ الصُّبْحِ بِقُبَاءٍ إِذْ جَاءَهُمْ آتٍ فَقَالَ إِنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَدْ أُنْزِلَ عَلَيْهِ اللَّيْلَةَ ‏.‏ وَقَدْ أُمِرَ أَنْ يَسْتَقْبِلَ الْكَعْبَةَ فَاسْتَقْبِلُوهَا ‏.‏ وَكَانَتْ وُجُوهُهُمْ إِلَى الشَّامِ فَاسْتَدَارُوا إِلَى الْكَعْبَةِ ‏.‏
Reference : Sahih Muslim 526a
In-book reference : Book 5, Hadith 18
USC-MSA web (English) reference : Book 4, Hadith 1073
  (deprecated numbering scheme)