Sayyiduna Ibn Abbas (may Allah be pleased with them both) said: "The Prophet (peace and blessings be upon him) used to pray towards Bayt al-Maqdis while he was in Makkah, with the Ka'bah in front of him (peace and blessings be upon him), and it remained so for sixteen months after the Hijrah as well; then he (peace and blessings be upon him) turned towards the Ka'bah."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11020