Abdullah bin Abbas reported,

The first thing Allah abrogated in the Quran was the qibla. When the Messenger of Allah ﷺ migrated to Madinah, most of its people were Jews, and Allah عز وجل commanded him to face Bayt al-Maqdis. This delighted the Jews, and the Messenger of Allah ﷺ faced it for some ten months and more. But the Messenger of Allah ﷺ loved the qibla of Ibrahim, so he would pray and look up toward the sky. Then Allah تبارك وتعالى revealed, "We have certainly seen you turning your face about toward the heaven" up to His words, "so turn your faces toward it" [Baqarah 2:144].At this they were troubled and said, "What has turned them away from the qibla they were facing?" So Allah عز وجل revealed, "Say, to Allah belong the East and the West" [Baqarah 2:142]. And He said, "So wherever you turn, there is the face of Allah" [Baqarah 2:115].

Azami 1928

Sahih

عن ابن عباس قال

كان أول ما نسخ الله من القرآن القبلة، وذلك أن رسول الله ﷺ لما هاجر إلى المدينة، وكان أكثر أهلها اليهود، أمره الله عز وجل أن يستقبل بيت المقدس، ففرحت اليهود، فاستقبلها رسول الله ﷺ بضعة عشر شهرا، فكان رسول الله ﷺ يحب قبلة إبراهيم، فكان يدعو وينظر إلى السماء، فأنزل الله تبارك وتعالى: {قد نرى تقلب وجهك في السماء} إلى قوله: {فولوا وجوهكم شطره} [البقرة: ١٤٤]. فارتاب من ذلك، وقالوا: {ما ولهم عن قبلتهم التي كانوا عليها}، فأنزل الله عز وجل: {قل لله المشرق والمغرب} [البقرة: ١٤٢]. وقال: {فأينما تولوا فثم وجه الله} [البقرة: ١١٥].

الأعظمي 1928صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Description of prayer, the takbir, standing, and recitation
Section
Changing the qibla from Bayt al-Maqdis to the Sacred House of Allah
Numbering
Jami al-Kamil 1928 (2nd edition)
Azami 1928