While some people were offering Fajr prayer in the Quba' mosque, some-one came and said, "Allah has revealed to the Prophet ﷺ Qur'anic instructions that you should face the Kaʿba (while praying) so you too, should face it." Those people then turned towards the Kaʿba.
أَنْزَلَ اللَّهُ عَلَى النَّبِيِّ ﷺ قُرْآنًا أَنْ يَسْتَقْبِلَ الْكَعْبَةَ فَاسْتَقْبِلُوهَا فَتَوَجَّهُوا إِلَى الْكَعْبَةِ