Mihrab (Arabic: محراب miḥrāb, pl. محاريب maḥārīb) is a semicircular niche in the wall of a mosque that indicates the qibla; that is, the direction of the Kaaba in Mecca and hence the direction that Muslims should face when praying. The wall in which a mihrab appears is thus the "qibla wall".
The word is derived from Iranian mythology, as described in the "History" section below.
The word mihrab originally had a non-religious meaning and simply denoted a special room in a house; a throne room in a palace, for example. The Fath al-Bari (p. 458), on the authority of others, suggests the mihrab is "the most honorable location of kings" and "the master of locations, the front and the most honorable." The Mosques in Islam (p. 13), in addition to Arabic sources, cites Theodor Nöldeke and others as having considered a mihrab to have originally signified a throne room.
The term was subsequently used by the Islamic prophet Muhammad to denote his own private prayer room. The room additionally provided access to the adjacent mosque, and the Prophet would enter the mosque through this room. This original meaning of mihrab – i.e. as a special room in the house – continues to be preserved in some forms of Judaism where mihrabs are rooms used for private worship. In the Qur'an (xix.11), the word mihrab refers to a sanctuary/place of worship.
During the reign of the Uthman ibn Affan (r. 644–656), the Caliph ordered a sign to be posted on the wall of the mosque at Medina so that pilgrims could easily identify the direction in which to address their prayers (i.e. that of Mecca). The sign was however just a sign on the wall, and the wall itself remained flat. Subsequently, during the reign of Al-Walid ibn Abd al-Malik (Al-Walid I, r. 705–715), the Al-Masjid al-Nabawi (Mosque of the Prophet) was renovated and the governor (wāli) of Medina, Umar ibn AbdulAziz, ordered that a niche be made to designate the qibla wall (which identifies the direction of Mecca), and it was in this niche that Uthman's sign was placed.
Eventually, the niche came to be universally understood to identify the qibla wall, and so came to be adopted as a feature in other mosques. A sign was no longer necessary.
Today, Mihrabs vary in size, are usually ornately decorated and often designed to give the impression of an arched doorway or a passage to Mecca.
In exceptional cases, the mihrab does not follow the qibla direction. One example is the Mezquita of Córdoba, Spain that points south instead of southeast. Among the proposed explanations, there is the localization of the ancient Roman cardo street besides the old temple the Mezquita was built upon.
Another is the Masjid al-Qiblatayn, or the Mosque of the Two Qiblas. This is where the Prophet Muhammad received the command to change the direction of prayer (qibla) from Jerusalem to Mecca, thus has two prayer niches. In the 21st Century the mosque was renovated, and the old prayer niche facing Jerusalem was removed, and the one facing Mecca was left.