Initially the Prophet ﷺ was commanded to pray facing Bayt al-Maqdis (Jerusalem), and did so throughout his time in Makkah, reportedly positioning himself so the Ka'bah was also in line, a kind of "double qibla." When he emigrated to Madinah, due north of Makkah with Bayt al-Maqdis further north still, he had to turn his back to the Ka'bah to face Jerusalem. As tensions grew with the Jews of Madinah, who had at first given the Prophet ﷺ real hope, believing in the same God, the same line of prophets, Paradise, Hell, and Judgment Day, and having a chief rabbi, Abdullah ibn Salam RA, who converted, the Prophet ﷺ began wishing to face Makkah instead. He could not change it by his own will: it is narrated that he once told Jibril AS, "O Jibril, I wish to pray facing Makkah," and Jibril AS replied that he was only a slave commanded by Allah, and that the Prophet ﷺ should make du'a. The Prophet ﷺ then began making du'a earnestly, by night and by day, looking up to the sky, something he did only at times of extreme distress. Allah then revealed the command in Qur'an 2:144 to turn towards Masjid al-Haram, followed by further verses in the opening of the second juz. The Jews and even some Muslims and mushrikun were confused, since abrogation (naskh) itself was a new concept; some Jews openly mocked the change, and Allah responded that piety is not about which direction one faces (2:177) and that no amount of proof would make the People of the Book follow the Muslims' qibla, or vice versa (2:145). The sahaba also asked whether those who had died praying towards Bayt al-Maqdis would have their prayers accepted, prompting the revelation that Allah would never let their faith go to waste (2:143), a verse later used by scholars such as Imam Bukhari as evidence that salah is inseparable from iman.
Outcome: The qibla for all Muslim prayer was permanently changed from Bayt al-Maqdis to the Ka'bah in Makkah.
Significance
The first ruling Allah ever abrogated in Islam, and a major turning point in relations with the Jews of Madinah: it showed them the Prophet ﷺ followed the true, original religion of Ibrahim AS (the first qibla), while also signalling that he now superseded their line and that their unique status as "the chosen people" had come to an end. It was also a message to the mushrikun that the Prophet ﷺ, not they, would be the rightful custodian and inheritor of the Ka'bah. Along the way, it occasioned the revelation of Qur'an 2:143's "ummatan wasata," and became the primary evidence used by early scholars for the ruling on abandoning prayer.
Narration · early in the Madani period, contrasted with what followed
When the Prophet ﷺ first came to Madinah, he wanted to resemble the Jews as much as possible, so that they would feel he was one of them. It was only once it became clear the Jews had made up their minds never to accept him that he began commanding the Muslims to be different from them in every way they could.
“Indeed, We see you [O Prophet] turning your face towards heaven. Now We will make you turn towards a direction [of prayer] that will please you. So from now on, turn your face in the direction of Masjid al-Haram; and wherever you are, turn your face in that direction.”
This ayah is part of the Qibla-change passage of Surah al-Baqarah, revealed around the change of the direction of prayer from Jerusalem to the Ka'bah.
“We have made you an ummatan wasata (outstanding nation). ... We changed the qibla only to test those who followed the Prophet ﷺ versus those who rejected the Prophet ﷺ. ... Allah will never cause your faith to be wasted away.”
This ayah is part of the Qibla-change passage of Surah al-Baqarah, revealed around the change of the direction of prayer from Jerusalem to the Ka'bah.
“Even if you were to bring every proof to the People of the Book, they won't follow your qibla; and you will not follow their qibla; and they themselves don't follow each other's qibla.”
This ayah is part of the Qibla-change passage of Surah al-Baqarah, revealed around the change of the direction of prayer from Jerusalem to the Ka'bah.
Ep.034: cited alongside 2:47 as evidence the Jews viewed themselves as the chosen people, explaining the wisdom of the qiblah change as a message directed at them.
“The foolish people will begin questioning, "Why have they turned away from the qibla that they were upon?"”
This ayah opens Allah's reply to the exact taunt dramatized in the post ("Why did they change the qibla?") -- Q2:142 quotes that objection before answering it.