“Allah would never allow your faith to be lost; indeed, Allah is Most Kind, Most Merciful to mankind” (al-Baqarah 2:134).
Muslim (1) transmits the same report through another chain.
Ibn Abī Ḥātim (2) says: Abū Zurʿah narrated to us; al-Ḥasan ibn ʿAṭiyyah narrated to us; Isrāʾīl narrated to us from Abū Isḥāq, from al-Barāʾ, who said:
“The Messenger of Allah ﷺ prayed toward Bayt al-Maqdis for sixteen—or seventeen—months and wished to be directed toward the Kaʿbah. Then Allah revealed: ‘We have certainly seen your face turning toward the heaven; so We shall surely turn you to a direction of prayer that pleases you. Turn, therefore, your face toward the Sacred Mosque’ (al-Baqarah 2:144). So he turned toward the Kaʿbah.
“The foolish among the people—the Jews—said, ‘What has turned them away from the qiblah they had been facing?’ So Allah revealed: ‘Say, “To Allah belong the East and the West; He guides whom He wills to a straight path”’ (al-Baqarah 2:142).”
In short, the Messenger of Allah ﷺ used to pray in Mecca toward Jerusalem while the Kaʿbah remained before him, as Imām Aḥmad (3) relates from Ibn ʿAbbās, may Allah be pleased with him. When he emigrated to Madinah he could no longer combine the two directions, so he prayed toward Jerusalem on first arriving there, turning his back to the Kaʿbah for sixteen—or seventeen—months. This indicates that the change occurred in Rajab of the second year after the Hijrah, and Allah knows best.
The Prophet ﷺ desired that his qiblah be directed to the Kaʿbah, the qiblah of Abraham. He therefore multiplied his supplications, entreaties, and earnest pleas to Allah, Exalted is He, raising his hands and his gaze toward the sky until Allah revealed (4): ‘We have certainly seen your face turning toward the heaven; so We shall surely turn you to a direction of prayer that pleases you. Turn, therefore, your face toward the Sacred Mosque…’
When the command to change the qiblah was revealed, the Messenger of Allah ﷺ addressed the Muslims and informed them, as al-Nasāʾī (5) relates on the authority of Abū Saʿīd ibn al-Muʿallā, stating that this occurred at the time of the Ẓuhr prayer.
Some scholars (6)—Mujāhid and others—have said that the revelation came between the two prayers.
This is supported by the authentic report in the two Ṣaḥīḥs (7) from al-Barāʾ that the first prayer the Prophet ﷺ performed facing the Kaʿbah in Madinah was the ʿAṣr prayer. Remarkably, the people of Qubāʾ did not receive the news until the dawn prayer of the following day,
as is likewise established in the two Ṣaḥīḥs (8) from Ibn ʿUmar, who said: “While the people of Qubāʾ were performing the dawn prayer, someone came to them…”