The site was originally adjacent to Muhammad's house; he settled there after his Hijra (emigration) to Medina in 622 CE. He shared in the heavy work of construction. The original mosque was an open-air building. The mosque also served as a community center, a court, and a religious school. There was a raised platform for the people who taught the Quran. Subsequent Islamic rulers greatly expanded and decorated it. In 1909, it became the first place in the Arabian Peninsula to be provided with electrical lights.[2] The mosque is under the control of the Custodian of the Two Holy Mosques. The mosque is located in what was traditionally the center of Medina, with many hotels and old markets nearby. It is a major pilgrimage site. Many pilgrims who perform the Hajj go on to Medina to visit the mosque due to its connections to the life of Muhammad.

After an expansion during the reign of the Umayyad caliph al-Walid I, it also now incorporates the final resting place of Muhammad and the first two Rashidun caliphsAbu Bakr and Umar.[3] One of the most notable features of the site is the Green Dome in the south-east corner of the mosque,[4] originally Aisha's house,[3] where the tomb of Muhammad is located. In 1279, a wooden cupola was built over the tomb which was later rebuilt and renovated multiple times in late 15th century and once in 1817. The current dome was added in 1818 by the Ottoman sultanMahmud II,[4] and it was first painted green in 1837, hence becoming known as the "Green Dome".[3]

The mosque was built by Muhammad in 622 after his arrival in the city of Medina.[5] Riding in a camel called Qaswa he arrived at the place where this mosque was built. The land was owned by Sahal and Suhayl, which was used as a burial ground and part of for drying date. Refusing to "accept the land as a gift", he bought the land and it took seven months to complete the construction of the mosque. It measured 30.5 metres (100 ft) × 35.62 metres (116.9 ft).[6] The roof which was supported by palm trunks was made of beaten clay and palm leaves. It was at a height of 3.60 metres (11.8 ft). The three doors of the mosque were Bab-al-Rahmah to the south, Bab-al-Jibril to the west and Babal-Nisa to the east.[6]

After the Battle of Khaybar, the mosque was "enlarged".[7] The mosque extended for 47.32 metres (155.2 ft) on each side and three rows of columns were built beside the west wall, which became the place of praying.[8] The mosque remained unaltered during the reign of the first Rashidun caliphAbu Bakr.[8] The second caliphUmar demolished all the houses around the mosque except that of Muhammad's wives to expand it.[9] The new mosque's diemensions became 57.49 metres (188.6 ft) × 66.14 metres (217.0 ft). Sun-dried mud bricks were used to construct the walls of the enclosure. Besides strewing pebbles on the floor, the roof's height was increased to 5.6 metres (18 ft). Umar moreover constructed three more gates for entrance. He also added the Al-Butayha for people to recite poetry.[10]

The third caliph Uthman demolished the mosque in 649. Ten months were spent in building the new rectangular shaped mosque whose face was turned towards the Mecca. The new mosque measured 81.40 metres (267.1 ft) × 62.58 metres (205.3 ft). The number of gates as well as their names remained the same.[11] The enclosure walls were made of stones laid in mortar. The palm trunk columns were replaced by stone columns which were joined by iron clamps. Teakwood was used in reconstructing the ceiling.[12]

In 707, UmayyadcaliphAl-Walid ibn Abd al-Malik renovated the mosque. It took three years for the work to be completed. Raw materials were procured from the Byzantine Empire.[13] The area of the mosque was increased from 5094 sq. metre of Uthman's time to 8672 sq metre. A wall was built to segregate the mosque and the houses of the wives of Muhammad. The mosque was reconstructed in a trapezoid shape with a length of 101.76 metres (333.9 ft). For the first time, porticoes were built in the mosque connecting the northern part of the structure to the sanctuary. For the first time, minarets were built in Medina as he constructed four minarets around it.[14]

Abbasid caliph Al-Mahdi he extended the mosque to the north by 50 metres (160 ft). His name was also inscribed on the walls of the mosque. He also planned to remove six steps to the minbar, but abandoned this idea, owing to this causing damage of the woods on which they were built.[15] According to an inscription of Ibn Qutaybah, the third caliph Al-Mamun did "unspecified work" on the mosque. Al-Mutawakkil lined the enclosure of Muhammad's tomb with marble.[16]Al-Ashraf Qansuh al-Ghawri built a dome of stone over his grave in 1476.[17]

The Rawdah (referred to as al-Rawdah al-Mutaharah), covered by the dome over the south-east corner of the mosque,[4] was constructed in 1817C.E. during the reign of Sultan Mahmud II. The dome was painted green in 1837 C.E. and came to be known as the "Green Dome".[3]

The Sultan Abdul Majid I took thirteen years to rebuild the mosque, which started in 1849.[18] Red stone bricks were used as the main material in reconstruction of the mosque. The floor area of the mosque was increased by 1293 square metre. On the walls, verses from the Quran were inscribed in Islamic calligraphy. In the northern side of the mosque, a madrasah was built for "teaching Quranic lessons".[19]

When Ibn Saud took Medina in 1905, his followers, the Wahhabis, demolished nearly every tomb dome in Medina in order to prevent their veneration,[20] and the Green Dome is said to have narrowly escaped the same fate.[21] Muhammad's tomb was stripped of its gold and jewel ornaments, but the dome was preserved either because of an unsuccessful attempt to demolish its hardened structure, or because some time ago Ibn Abd al-Wahhab wrote that he did not wish to see the dome destroyed despite his aversion to people praying at the tomb.[20] Similar events took place in 1925 when the Saudi ikhwans retook—and this time managed to keep—the city.[22][23][24][25] In the Wahabi interpretation of Islam, the veneration of tombs and places thought to possess supernatural powers was an offense against tawhid.[26]

After the foundation of the Kingdom of Saudi Arabia in 1932, the mosque underwent several major modifications. In 1951 King Ibn Saud (1932–1953) ordered demolitions around the mosque to make way for new wings to the east and west of the prayer hall, which consisted of concrete columns with pointed arches. Older columns were reinforced with concrete and braced with copper rings at the top. The Suleymaniyya and Majidiyya minarets were replaced by two minarets in Mamluk revival style. Two additional minarets were erected to the northeast and northwest of the mosque. A library was built along the western wall to house historic Qurans and other religious texts.[19][27]

In 1974, King Faisal added 40,440 square metres to the mosque.[28] The area of the mosque was also expanded during the reign of King Fahd in 1985. Bulldozers were used to demolish buildings around the mosque.[29] In 1992, when it was completed, the area of the mosque became 1.7 million square feet. Escalators, 27 courtyards were amongst the additions to the mosque.[30]

A $6 billion project for increasing the area of the mosque was announced in September 2012. RT reported that after the end of the work, it would accommodate 1.6 million people.[31] In March of the following year, Saudi Gazette wrote "95 percent of the demolition work has been completed. About 10 hotels to the eastern side of the expansion were leveled to the ground in addition to a number of houses and other utilities to make way for the expansion."[32]

The two tiered mosque has a rectangular plan. The Ottoman prayer hall faces towards the south.[33] It has a flat paved roof topped with 27 sliding domes on square bases.[34] Holes pierced into the base of each dome illuminate the interior. The roof is also used for prayer during peak times, when the domes slide out on metal tracks to shade areas of the roof, creating light wells for the prayer hall. At these times, the courtyard of the Ottoman mosque is also shaded with umbrellas affixed to freestanding columns.[35] The roof is accessed by stairs and escalators. The paved area around the mosque is also used for prayer, equipped with umbrella tents.[36] Sliding Domes and retractable umbrella-like canopies are designed by the German architect Mahmoud Bodo Rasch and his firm SL Rasch GmbH and Buro Happold.[37]

The heart of the mosque houses a very special but small area named Riad ul-Jannah (Gardens of Paradise). It extends from Muhammad's tomb (Rawdah) to his pulpit (minbar). Pilgrims attempt to visit the confines of the area, for there is a tradition that supplications and prayers uttered here are never rejected. Entrance into the area is not always possible, especially during the Hajj season, as the space can only accommodate a few hundred people.

Riad ul-Jannah is considered to be a part Jannah (Paradise). It was narrated from Abu Hurayrah that Muhammad said, "The area between my house and my minbar is one of the gardens of Paradise, and my minbar is on my cistern (hawd)."[38]

As per Muhammad, Rawdah is also in Heaven, the same Rawdah which is currently in the mosque. It is floored with Green Carpet just to identify it, and the entire Mosque is floored with red carpet. It holds the tomb of Muhammad and two of his companions and first Caliphs, Abu Bakr and Umar ibn al-Khattab. A fourth grave is reserved for Jesus, as it is believed that he will return and will be buried at the site. The site is covered by the Green Dome. It was constructed in 1817 C.E. during the reign of Ottoman Sultan Mahmud II and painted green in 1837 C.E.[3]

There are two mihrabs in the mosque, one was built by Muhammad and another was built by the third Rashidun caliphUthman. The one built by the latter was larger than that of Muhammad's and act as the functional mihrab, whereas Muhammad's mihrab is a "commemorative" mihrab.[39] Besides the mihrab, the mosque also has other niches which act as indicators for praying. This include mihrab al-tahajjud which was built by Muhammad for the tahajjud, mihrab Fatima.[40]

The original minbar used by Muhammad was a "wood block of date tree". This was replaced by him with a tamarisk one, which had a diemensions of 50 centimetres (0.50 m) x 125 metres (410 ft). Also in 629 a three staired ladder was added to it. The first two caliphsAbu Bakr and Umar did not use the third step due to "due to respect for the Prophet", but the third caliph Uthman placed a fabric dome over it and the rest of the stairs were covered with ebony. The minbar was replaced by Baybars I in 1395 and later by Shaykh al-Mahmudi in 1417. This was also replaced by a marble one by Kayitbay in late fifeteenth century, which as of August 2013, it still used in the mosque.[40]

The first minarets (four in number) of 26 feet (7.9 m) high were constructed by Umar. In 1307, a minaret titled Bab al-Salam was added by Muhammad ibn Kalavun which was renovated by Mehmed IV. After the renovation project of 1994, there were ten minarets whcih were 104 metres (341 ft) high. The minarets' upper, bottom and middle portion are cylindrical, octagonal and square shaped respectively.[40]

^Islam-QA: "Islamic Guidelines for Visitors to the Prophet’s Mosque"Islam-QA website section 5- It is prescribed for the one who visits the Prophet’s Mosque to pray two rakats in the Rawdah or whatever he wants of supplementary prayers, because it is proven that there is virtue in doing so. It was narrated from Abu Hurayrah that the Prophet said, "The area between my house and my mimbar is one of the gardens of Paradise, and my mimbar is on my cistern (hawd)." Narrated by al-Bukhari, 1196; Muslim, 1391.