It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) and his companions (may Allah be pleased with them) prayed facing Bayt al-Maqdis for sixteen months, then the direction of the Qiblah was changed.