Sahih Muslim Book 4, Hadith Number 1073.

Chapter : Building of the Prophet’s Mosque in Medina.

Ibn ‘Umar reported: As the people were praying at Quba’ a man came to them and said: It has been revealed to file Messenger of Allah (may peace be upon him) during the night and he has been directed to turn towards the Ka’ba. So turn towards it. Their faces were towards Syria and they turned round towards Ka’ba.