Bara bin Azib reported,

The Messenger of Allah ﷺ prayed facing Bayt al-Maqdis for sixteen, or seventeen, months. The Messenger of Allah ﷺ wished to be turned toward the Kaaba, so Allah revealed, "We have surely seen you turning your face about toward the heaven" [Baqarah 2:144], and he turned toward the Kaaba.The foolish among the people, meaning the Jews, said, "What has turned them away from the qiblah they used to face? Say, To Allah belong the east and the west. He guides whom He wills to a straight path" [Baqarah 2:142].A man prayed with the Prophet ﷺ, and after finishing he went out and passed by a group of the Ansar who were praying Asr facing Bayt al-Maqdis. He said, "I bear witness that I prayed with the Messenger of Allah ﷺ, and that he turned toward the Kaaba."So the group shifted around until they were facing the Kaaba.

Azami 1921

Sahih

عن البراء بن عازب قال

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

الأعظمي 1921صحيح
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 1921 (2nd edition)
Azami 1921