It is narrated from Ibn Umar (may Allah be pleased with them both) that he said: "The people were performing the Fajr prayer in Quba when a man came and informed them that during the night, Qur'an had been revealed to the Prophet ﷺ in which he was commanded to face the Ka'bah (in prayer). So those people also turned their faces towards the Ka'bah, while at that time their faces were towards Syria; they all turned towards the Ka'bah."
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 178
Hadith Takhrijأخرجہ البخاری، الصلاۃ، باب ماجاء فی القبلۃ، ومن لم یر الاعادة علی من سہا، فصلی الی غیر القبلۃ: 403 - ومسلم، المساجد، باب تحویل القبلۃ من القدس الی الکعبة: 526