Bara bin Azib reported,

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

Nasai 743

Sahih

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

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

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

النسائي 743صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Qibla
Chapter
Facing the qibla
Numbering
Darussalam 743
Nasai 743