Abdullah bin Umar reported,

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.

Bukhari 7251

Sahih

حدثنا إسماعيل حدثني مالك عن عبد الله بن دينار

عن عبد الله بن عمر قال

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

البخاري 7251صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Reports of single narrators
Chapter
Acceptance of the report of a single truthful narrator regarding adhan, prayer, fasting, obligations, and rulings
Numbering
Darussalam 7251
Bukhari 7251