Bara bin Azib reported,

The Messenger of Allah ﷺ arrived in Medina and prayed facing Bayt al-Maqdis for sixteen months. Then he was directed to face the Kaabah. A man who had prayed with the Prophet ﷺ passed by a group from the Ansar and said, "I bear witness that the Messenger of Allah ﷺ has been directed to face the Kaabah." So they turned toward the Kaabah.

Nasai 490

Sahih

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

عن البراء بن عازب قال

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

النسائي 490صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Prayer
Chapter
Obligation of the qibla
Numbering
Darussalam 490
Nasai 490