[Machine] The Prophet ﷺ used to pray facing the Qibla (the Kaaba in Mecca). But when it was changed, a man went to the people of Quba and found them praying the morning prayer. He said, "Indeed, the Messenger of Allah ﷺ was commanded to pray towards the Kaaba." So their imam turned around until they faced the Qibla.
أَنَّ النَّبِيَّ ﷺ كَانَ يُصَلِّي قِبَلَ بَيْتِ الْمَقْدِسِ فَلَمَّا حُوِّلَ انْطَلَقَ رَجُلٌ إِلَى أَهْلِ قُبَاءَ فَوَجَدَهُمْ يُصَلُّونَ صَلَاةَ الْغَدَاةِ فَقَالَ إِنَّ رَسُولَ اللهِ ﷺ أُمِرَ أَنْ يُصَلِّيَ إِلَى الْكَعْبَةِ فَاسْتَدَارَ إمَامُهُمْ حَتَّى اسْتَقْبَلَ بِهِمُ الْقِبْلَةَ