The price agreed upon was paid by Abu Ayyub al-Ansari, who thus became the endower or donor (Arabic: وَاقِف, romanized: wāqif) of the mosque, on behalf or in favor of Muhammad.
Originally an open-air building, the mosque served as a community center, a court of law, and a religious school.
It contained a raised platform or pulpit (minbar) for the people who taught the Quran and for Muhammad to give the Friday sermon (khutbah).
Subsequent Islamic rulers greatly expanded and decorated the mosque, naming its walls, doors and minarets after themselves and their forefathers.
[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 1909, under the reign of Ottoman Sultan Abdul Hamid II, it became the first place in the Arabian Peninsula to be provided with electrical lights.
[5] From the 14th century, the mosque was guarded by eunuchs, the last remaining guardians were photographed at the request of then-Prince Faisal bin Salman Al Saud, and in 2015, only five were left.
[9] Riding a camel called Qaswa, he arrived at the place where this mosque was built, which was being used as a burial ground.
In the year 7 AH, after the Battle of Khaybar, the mosque was expanded[11] to 47.32 m (155.2 ft) on each side, and three rows of columns were built beside the west wall, which became the place of praying.
Ten months were spent in building the new rectangular shaped mosque whose face was turned towards the Kaaba in Mecca.
[17][18] According to the architectural historian Robert Hillenbrand, the building of a large scale mosque in Medina, the original center of the caliphate, was an "acknowledgement" by al-Walid of "his own roots and those of Islam itself" and possibly an attempt to appease Medinan resentment at the loss of the city's political importance to Syria under the Umayyads.
[19] Al-Walid lavished large sums for the mosque's reconstruction and supplied mosaics and Greek and Coptic craftsmen.
[21] According to the 10th-century writer Ibn Rusta, minarets were also built for the first time during al-Walid's expansion as four towers were added to the mosque's corners.
He also planned to remove six steps to the minbar, but abandoned this idea, fearing damage to the wooden platforms on which they were built.
[29] In 1269, the Mamluk sultan Baybars sent dozens of artisans led by the eunuch Emir Jamal al-Din Muhsin al-Salihi to rebuild the sanctuary, including enclosures around the tombs of Muhammad and of Fatima.
[31] Sultan Suleiman the Magnificent (r. 1520–1566) rebuilt the east and west walls of the mosque, and added the northeastern minaret known as Süleymaniyye.
[citation needed] In 1817, Sultan Mahmud II (r. 1808–1839) completed the construction of "the Purified Residence" (Ar-Rawdah Al-Muṭahharah (ٱلرَّوْضَة ٱلْمُطَهَّرَة) in Arabic, and Ravza-i Mutahhara in Turkish) on the southeast side of the mosque, and covered with a new dome.
[citation needed] The entire mosque was reorganized except for the tomb of Muhammad, the three altars, the pulpit and the Suleymaniye minaret.
[35] As per the sahih hadiths, they considered the veneration of tombs and places, which were thought to possess supernatural powers, as an offence against tawhid, and an act of shirk.
[36] 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 complex and hardened structure, or because some time ago, Muhammad ibn Abd al-Wahhab, founder of the Wahhabi movement, wrote that he did not wish to see the dome destroyed.
[34] The Saudi takeover was characterized by events similar to those that took place in 1805, when the Prince Mohammed ibn Abdulaziz retook the city on 5 December 1925.
In 1951, King Abdulaziz (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.
When the domes slide out on metal tracks to shade areas of the roof, they create light wells for the prayer hall.
[49] The chamber adjacent to the Rawdah holds the tombs of Muhammad and two of his companions and father-in-laws, Abu Bakr and Umar.
Abu Bakr and Umar did not use the third step as a sign of respect to Muhammad, but Uthman placed a fabric dome over it, and the rest of the stairs were covered with ebony.
[52][better source needed] In 1307, a minaret titled Bāb as-Salām (بَاب ٱلسَّلَام, "Gate of the Peace") was added by al-Nasir Muhammad which was renovated by Mehmed IV.
The minarets' upper, middle, and bottom portions are cylindrical, octagonal, and square shaped respectively.