(32) بَابُ مَا جَاءَ فِي الْقِبْلَةِ، وَمَنْ لاَ يَرَى الإِعَادَةَ عَلَى مَنْ سَهَا فَصَلَّى إِلَى غَيْرِ الْقِبْلَةِ
Narrated `Abdullah bin `Umar:
While the people were offering the Fajr prayer at Quba' (near Medina), someone came to them and said: "It has been revealed to Allah's Messenger (ﷺ) tonight, and he has been ordered to pray facing the Ka`ba." So turn your faces to the Ka`ba. Those people were facing Sham (Jerusalem) so they turned their faces towards Ka`ba (at Mecca). (JA)
Reference (JA): Sahih al-Bukhari 403 (JA)
In-book reference (JA): Book 8, Hadith 55 (JA)
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 1, Book 8, Hadith 397 (JA)