حَدَّثَنَا عَمْرُو بْنُ خَالِدٍ، قَالَ حَدَّثَنَا زُهَيْرٌ، قَالَ حَدَّثَنَا أَبُو إِسْحَاقَ، عَنِ الْبَرَاءِ، أَنَّ النَّبِيَّ صلى الله عليه وسلم كَانَ أَوَّلَ مَا قَدِمَ الْمَدِينَةَ نَزَلَ عَلَى أَجْدَادِهِ ـ أَوْ قَالَ أَخْوَالِهِ ـ مِنَ الأَنْصَارِ، وَأَنَّهُ صَلَّى قِبَلَ بَيْتِ الْمَقْدِسِ سِتَّةَ عَشَرَ شَهْرًا، أَوْ سَبْعَةَ عَشَرَ شَهْرًا، وَكَانَ يُعْجِبُهُ أَنْ تَكُونَ قِبْلَتُهُ قِبَلَ الْبَيْتِ، وَأَنَّهُ صَلَّى أَوَّلَ صَلاَةٍ صَلاَّهَا صَلاَةَ الْعَصْرِ، وَصَلَّى مَعَهُ قَوْمٌ، فَخَرَجَ رَجُلٌ مِمَّنْ صَلَّى مَعَهُ، فَمَرَّ عَلَى أَهْلِ مَسْجِدٍ، وَهُمْ رَاكِعُونَ فَقَالَ أَشْهَدُ بِاللَّهِ لَقَدْ صَلَّيْتُ مَعَ رَسُولِ اللَّهِ صلى الله عليه وسلم قِبَلَ مَكَّةَ، فَدَارُوا كَمَا هُمْ قِبَلَ الْبَيْتِ، وَكَانَتِ الْيَهُودُ قَدْ أَعْجَبَهُمْ إِذْ كَانَ يُصَلِّي قِبَلَ بَيْتِ الْمَقْدِسِ، وَأَهْلُ الْكِتَابِ، فَلَمَّا وَلَّى وَجْهَهُ قِبَلَ الْبَيْتِ أَنْكَرُوا ذَلِكَ‏.‏ قَالَ زُهَيْرٌ حَدَّثَنَا أَبُو إِسْحَاقَ عَنِ الْبَرَاءِ فِي حَدِيثِهِ هَذَا أَنَّهُ مَاتَ عَلَى الْقِبْلَةِ قَبْلَ أَنْ تُحَوَّلَ رِجَالٌ وَقُتِلُوا، فَلَمْ نَدْرِ مَا نَقُولُ فِيهِمْ، فَأَنْزَلَ اللَّهُ تَعَالَى ‏{‏وَمَا كَانَ اللَّهُ لِيُضِيعَ إِيمَانَكُمْ‏}‏
Translation
Narrated Al-Bara' (bin 'Azib)

When the Prophet (ﷺ) came to Medina, he stayed first with his grandfathers or maternal uncles from Ansar. He offered his prayers facing Baitul-Maqdis (Jerusalem) for sixteen or seventeen months, but he wished that he could pray facing the Ka'ba (at Mecca). The first prayer which he offered facing the Ka'ba was the 'Asr prayer in the company of some people. Then one of those who had offered that prayer with him came out and passed by some people in a mosque who were bowing during their prayers (facing Jerusalem). He said addressing them, "By Allah, I testify that I have prayed with Allah's Messenger (ﷺ) facing Mecca (Ka'ba).' Hearing that, those people changed their direction towards the Ka'ba immediately. Jews and the people of the scriptures used to be pleased to see the Prophet (ﷺ) facing Jerusalem in prayers but when he changed his direction towards the Ka'ba, during the prayers, they disapproved of it.

Al-Bara' added, "Before we changed our direction towards the Ka'ba (Mecca) in prayers, some Muslims had died or had been killed and we did not know what to say about them (regarding their prayers.) Allah then revealed: And Allah would never make your faith (prayers) to be lost (i.e. the prayers of those Muslims were valid).' " (2:143).

Comment

The Change of Qibla: Historical Context

This narration from Sahih al-Bukhari 40 describes the momentous transition from facing Jerusalem to facing the Ka'ba in prayer. The Prophet's stay with the Ansar and his sixteen-month prayer direction toward Baitul-Maqdis demonstrates the gradual nature of Islamic legislation, preparing the community for this significant change.

The 'Asr prayer marked the first implementation of the divine command to change qibla. The immediate compliance of the companions upon hearing the news reflects their absolute submission to Allah's decree and their unwavering trust in the Prophet's guidance.

Scholarly Commentary on the Qibla Change

The wisdom behind initially facing Jerusalem includes testing the believers' obedience and distinguishing between those who follow revelation unquestioningly and those who hesitate. It also established a connection with previous Abrahamic traditions before affirming Islam's distinct identity.

Jewish approval of the initial qibla and subsequent disapproval of the change reveals their expectation that the Prophet would conform to their traditions. The qibla change thus served as a decisive break, establishing Islam's independent spiritual orientation toward the primordial House of Allah built by Abraham and Ishmael.

Divine Reassurance in Revelation

The companions' concern about the validity of prayers offered by deceased Muslims before the qibla change demonstrates their meticulous care for religious matters. Allah's response in Surah Al-Baqarah (2:143) provides profound comfort, affirming that previous prayers remain valid and rewarded.

This incident establishes the important legal principle that actions are judged according to their time and context. It also shows Allah's mercy in not invalidating past worship due to subsequent legislative changes, reflecting the compassionate nature of Islamic jurisprudence.