قَوْلُهُ تَعَالَى: {فَوَلِّ وَجْهَكَ شَطْرَ الْمَسْجِدِ الْحَرَامِ} [البقرة: 144]
The Prophet ﷺ and his Companions used to pray in the direction of Jerusalem. When the following verse was revealed: “ So turn thy face towards the inviolable mosque”; and Ye (O Muslims), wheresoever ye may be, turn your face towards it”(ii. 144), a man passed by the people of Banu Salamah. He called them while they were bowing in the morning prayer facing Jerusalem: Lo, the qiblah (direction of prayer) has been changed towards the ka’bah. He called them twice. So they turned their faces towards the Ka’bah while they were bowing. (Using translation from Abū Dāʾūd 1045)
أَنَّ النَّبِيَّ ﷺ وَأَصْحَابَهُ كَانُوا يُصَلُّونَ نَحْوَ بَيْتِ الْمَقْدِسِ فَلَمَّا نَزَلَتْ هَذِهِ الْآيَةُ {فَوَلِّ وَجْهَكَ شَطْرَ الْمَسْجِدِ الْحَرَامِ} [البقرة 144] مَرَّ رَجُلٌ مِنْ بَنِي سَلِمَةَ فَنَادَاهُمْ وَهُمْ رُكُوعٌ فِي صَلَاةِ الْفَجْرِ أَلَا إِنَّ الْقِبْلَةَ قَدْ حُوِّلَتْ إِلَى الْكَعْبَةِ فَمَالُوا رُكُوعًا