Abdullah bin Umar reported,

While the people were performing the dawn prayer at Quba, someone came to them and said, "Revelation has come down upon 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 around toward the Kaabah.

Muslim 1178

Sahih

حدثنا شيبان بن فروخ حدثنا عبد العزيز بن مسلم حدثنا عبد الله بن دينار عن ابن عمر ح و حدثنا قتيبة بن سعيد واللفظ له عن مالك بن أنس عن عبد الله بن دينار

عن ابن عمر قال

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

مسلم 1178صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Mosques and places of prayer
Chapter
Changing the qibla from Jerusalem to the Kaaba
Numbering
Darussalam 1178
Muslim 1178