Sayyiduna Sahl bin Sa'd (may Allah be pleased with him) narrates: The Prophet (peace and blessings be upon him) used to pray facing Bayt al-Maqdis. When his direction was changed, a man went to the people of Quba' and found them praying the morning prayer. He told them: "The Prophet (peace and blessings be upon him) has been commanded to pray facing the Ka'bah." So their imam turned around until they faced the qiblah.
Al-Tabarani recorded it in al-Mu'jam al-Kabir, and its narrators have been declared trustworthy.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 1975