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.
بينا الناس يصلون الصبح في مسجد قباء إذ جاء فقال: أنزل الله على النبي ﷺ قرآنا أن يستقبل الكعبة، فاستقبلوها فتوجهوا إلى الكعبة.