While the people were at Quba performing the dawn prayer, someone came to them and said, "Quran has been revealed to the Messenger of Allah ﷺ tonight, and he has been commanded to face the Kaabah, so face it." Their faces had been toward Sham, so they turned toward the Kaabah.
حدثنا إسماعيل حدثني مالك عن عبد الله بن دينار
بينا الناس بقباء في صلاة الصبح إذ جاءهم آت فقال إن رسول الله ﷺ قد أنزل عليه الليلة قرآن وقد أمر أن يستقبل الكعبة فاستقبلوها وكانت وجوههم إلى الشأم فاستداروا إلى الكعبة