Hadithcore
Sahih Muslim, 527
sahih

Anas reported:

The Messenger of Allah (ﷺ) used to pray towards Bait-ul-Maqdis, that it was revealed (to him):" Indeed We see the turning of the face to heaven, wherefore We shall assuredly cause you to turn towards Qibla which shall please you. So turn your face towards the sacred Mosque (Ka'ba)" (ii. 144). A person from Banu Salama was going; (he found the people) in ruk'u (while) praying the dawn prayer and they had said one rak'ah. He said in a loud voice: Listen! the Qibla has been changed and they turned towards (the new) Qibla (Ka'ba) in that very state.

حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا عَفَّانُ، حَدَّثَنَا حَمَّادُ بْنُ سَلَمَةَ، عَنْ ثَابِتٍ، عَنْ أَنَسٍ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ يُصَلِّي نَحْوَ بَيْتِ الْمَقْدِسِ فَنَزَلَتْ ‏{‏ قَدْ نَرَى تَقَلُّبَ وَجْهِكَ فِي السَّمَاءِ فَلَنُوَلِّيَنَّكَ قِبْلَةً تَرْضَاهَا فَوَلِّ وَجْهَكَ شَطْرَ الْمَسْجِدِ الْحَرَامِ‏}‏ فَمَرَّ رَجُلٌ مِنْ بَنِي سَلِمَةَ وَهُمْ رُكُوعٌ فِي صَلاَةِ الْفَجْرِ وَقَدْ صَلَّوْا رَكْعَةً فَنَادَى أَلاَ إِنَّ الْقِبْلَةَ قَدْ حُوِّلَتْ ‏.‏ فَمَالُوا كَمَا هُمْ نَحْوَ الْقِبْلَةِ ‏.‏

References2 variants
In-Book Reference
Book 5, Hadith 20
USC-MSA web (English) reference
Book 4, Hadith 1075 (deprecated numbering scheme)
Related hadiths2
Compare isnād across 2 related chains →