Abdullah bin Umar reported,

While the people were performing the dawn prayer at the Quba mosque, a man came and announced, "Allah has revealed to the Prophet ﷺ a portion of the Quran instructing him to face the Kaabah." So they turned and faced the Kaabah.

Azami 11927

Sahih

عن ابن عمر قال

بينا الناس يصلون الصبح في مسجد قباء إذ جاء فقال: أنزل الله على النبي ﷺ قرآنا أن يستقبل الكعبة، فاستقبلوها فتوجهوا إلى الكعبة.

الأعظمي 11927صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "The foolish among the people will say, 'What has turned them away from their qibla which they used to face?' Say, 'To Allah belongs the east and the Maghrib. He guides whom He wills to a straight path.' And thus We have made you a moderate nation that you will be witnesses over the people and the Messenger will be a witness over you. And We did not make the qibla which you used to face except that We might make evident who would follow the Messenger from who would turn back on his heels. And indeed, it was difficult except for those whom Allah has guided. And never would Allah cause your faith to be lost."
Numbering
Jami al-Kamil 11927 (2nd edition)
Azami 11927