It is narrated from Sayyiduna Sahl bin Sa'd (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) used to pray facing Bayt al-Maqdis (Jerusalem). Then, when the qiblah was changed, a man went to the people of Quba while they were praying the Fajr prayer. He said: The Messenger of Allah (peace and blessings be upon him) has been ordered to pray facing the Ka'bah. So their imam turned around within the prayer itself and turned the people towards the qiblah.
Hadith Referenceالمعجم الكبير للطبراني / باب السين / 5839