One of the earliest mosques of Medina. Muhammad first prayed in Medina while facing Jerusalem. However, after a period of sixteen or seventeen months, Muhammad received a revelation (Quran 2:142–43) instructing him to turn the direction of prayer (qiblah) toward Mecca. One tradition indicates that Muhammad was performing the noon prayer at the mosque of Banu Salama in Medina when he changed direction in the middle of the prayer. Other traditions indicate that news of the change of the qiblah was brought to Muslims praying in the Quba mosque in an oasis just outside Medina, prompting them to change direction in the middle of prayer. The foundations for this mosque were laid by Muhammad himself; upon his emigration from Mecca, Muhammmad first arrived at Quba, where he spent three days before continuing his trip to the center of Medina. The mosque wherein the direction was changed was thus known as the mosque of the two qiblahs, or the mosque where the same prayer was performed while facing the two qiblahs of Jerusalem and Mecca.