Masjid al-Qiblatain is a mosque in Medina that is historically important for Muslims as the place where the Islamic prophet Muhammad (PBUH), leading the prayer, is said to have been commanded to change the direction of prayer (qibla) from Jerusalem to Mecca. Thus it uniquely contained two prayer niches (mihrabs). Recently the mosque was renovated; the old prayer niche facing Jerusalem was removed, and the one facing Mecca was left. The Qiblatain Mosque is among the three earliest mosques in Islam's history, along with Quba Mosque and Al-Masjid al-Nabawi.
The name of the mosque goes back to the beginning of Islam when the companions of Muhammad (PBUH) named it after an event that took place. Muhammad (PBUH) was leading the prayer when he received a revelation from Allah instructing him to take the Kaaba as the Qiblah. According to traditional accounts, Muhammad (PBUH), who had been facing Jerusalem during the prayer, upon receiving this revelation, immediately turned around to face Mecca, and those praying behind him also did so. After this, the mosque in which this incident occurred came to be known as Masjid al-Qiblatain (i.e. 'Mosque of the Two Qiblas'). Many pilgrims who go to Mecca for hajj often visit Medina where some end up visiting the notable Qiblatain because of its historic significance.