Masjid al-Qiblatayn

The Masjid al-Qiblatayn (مسجد القبلتين, ), also spelt Masjid al-Qiblatain, is a mosque in Medina 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, and the one facing Mecca was left. 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.

History
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. Indeed, We see you ˺ O Prophet ˺ turning your face towards heaven. Now We will make you turn towards a ˺ direction of prayer ˺ that will please you. So turn your face towards the Sacred Mosque ˺ in Mecca ˺ —wherever you are, turn your faces towards it. Those who were given the Scripture certainly know this to be the truth from their Lord. And Allah is never unaware of what they do.

– Quran 2:144 (translated by Mustafa Khattab) A hadith from Sahih Bukhari says: "Narrated Ibn Umar: While some people were offering Fajr prayer at Quba' (mosque), some-one came to them and said, 'Tonight some Qur'anic Verses have been revealed to the Prophet and he has been ordered to face the Kaaba (during prayers), so you too should turn your faces towards it.' At that time their faces were towards Shaam (Jerusalem) so they turned towards the Kaaba (at Mecca)."

Architecture
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.