Masjid al-Qiblatayn

The Masjid al-Qiblatayn (Arabic: مسجد القبلتين, lit. 'Mosque of the Two Qiblas', standard pronunciation: [mas.dʒid al.qib.la.tajn], Hejazi Arabic pronunciation: [mas.dʒɪd al.ɡɪb.la.teːn]), also spelt Masjid al-Qiblatain, is a Sunni Islam mosque in Medina, Saudi Arabia. The mosque is believed by Muslims to be the place where the final Islamic prophet, Muhammad, received the command to change the Qibla (direction of prayer) from Jerusalem to Mecca. The mosque was built by Sawad ibn Ghanam ibn Ka'ab during the year 2 AH (623 CE) and is one of the few mosques in the world to have contained two mihrabs (niches indicating the qibla) in different directions.
In 1987, during the reign of King Fahd, the mosque was completely torn down and rebuilt. In the course of the reconstruction, the old prayer niche facing Jerusalem was removed, while the one facing Mecca was kept. The Qiblatayn Mosque is among the earliest mosques that date to the time of Muhammad, along with the Quba'a Mosque and Masjid an-Nabawi, considering that the Great Mosques of Mecca and Jerusalem are associated with earlier prophets in Islamic thought.
The mosque is among the earliest mosques in Medina and was built by Sawad ibn Ghanam ibn Ka'ab al-Ansari in the Islamic year 2 AH, and the name of the mosque goes back to the lifetime of Muhammad, when his companions named it after an event that took place on the 15th of Sha'baan the same year, when Muhammad received revelation from Allah instructing him to take the Kaaba as the qibla during the Dhuhr prayer, instead of Baytul Maqdis, which was the Masjid Al Aqsa in Jerusalem. He later announced this to his companions in his own mosque, after which the news began to spread. Many pilgrims who go to Mecca for Hajj often visit Medina, where some visit this mosque because of its historical significance.
A hadith from Sahih Bukhari says:
The main prayer hall adopts rigid orthogonal geometry and symmetry which is accentuated by the use of twin minarets and twin domes. Living accommodations for the Imam, the Muezzin and the caretaker are discretely grouped in one block to the west of the main structure. The difference in level at the southeast corner of the site has been exploited to incorporate a sub-basement level which serves as the ablutions area for worshippers. To the north, where the ground level is lower, the prayer hall is raised one-storey above ground level. Entry to the prayer hall is from the raised courtyard, also to the north, which can be reached by stairs and ramps from the main directions of approach. The prayer hall consists of a series of arches which support barrel-vaults running parallel to the qibla wall. These vaults are interrupted by two domes which establish an axis in the direction of Mecca.
The main dome to the south is raised on a drum of clerestory windows which allow light to filter into the interior directly above the mihrab. The second, false dome is linked to the first by a small cross-vault to symbolise the transition from one qibla to another. Below it, a replica of the mihrab found in the lower chamber of the Dome of the Rock in Jerusalem reminds onlookers of the oldest extant mihrab of Islam. Externally, the architectural vocabulary is inspired by traditional elements and motifs in a deliberate effort to offer an authentic image for the historic site. The mosque is located on the north-west of the city of Medina, on Khalid ibn al-Walid Road. The mosque was initially maintained by Caliph Umar ibn al-Khattāb. The last pre-modern renovation was by Suleiman the Magnificent who reconstructed the mosque.