The Messenger of Allah ﷺ used to pray facing Bayt al-Maqdis when the verse was revealed, "We have certainly seen the turning of your face toward the heaven, so We will surely turn you to a qiblah with which you will be pleased. So turn your face toward the Sacred Mosque" [Baqarah 2:144].A man from the tribe of Banu Salama passed by people who were bowing in the dawn prayer, having already completed one rakah. He called out, "Listen, the qiblah has been changed! Listen, the qiblah has been changed to the Kaabah!"So they turned, just as they were, toward the new qiblah.
حدثنا عفان حدثنا حماد عن ثابت
أن رسول الله ﷺ كان يصلي نحو بيت المقدس فنزلت {قد نرى تقلب وجهك في السماء فلنولينك قبلة ترضاها فول وجهك شطر المسجد الحرام} فمر رجل من بني سلمة وهم ركوع في صلاة الفجر وقد صلوا ركعة فنادى ألا إن القبلة قد حولت ألا إن القبلة قد حولت إلى الكعبة قال فمالوا كما هم نحو القبلة
Its isnad is sahih. Muslim narrated the story in 1/375, no. 526, in "the mosques, the change of the qibla," and Bukhari also narrated it in 8/171, no. 4486 (Fath), in the tafsir of "The fools among the people will say," and Darimi in 1/307, no. 1234, Rayyan edition.