Although its early history is unknown, Jewish settlers are known to have lived in Medina prior to the arrival of Christians. Historians say that the primary Jewish inflow occurred as a consequence of their forced removal from Palestine by Hadrian, the Roman emperor, in 135 CE. The oasis was likely occupied at the time by the Arab tribes of Aws and Khazraj, but by 400 CE, the Jews had become the area's main population and development force. The city was originally called Yethrib, but after the prophet ﷺ took control of the city, he renamed it Medina.
In the year 1 Hijra, or 622 CE, the Prophet Muhammad ﷺ made the Hirji (migration) to Medina after being forced out of Makkah. This introduced a new chapter for the small city, as it soon became a majority Muslim territory.
Upon arriving in Medina, the prophet ﷺ built two masjids (mosques), Masjid al-Quba and Masjid an-Nabawi.
The first was Masjid al-Quba (built closer to the outskirts of Medina), but the second and most prominent was and is Masjid an-Nabawi, as it is also known as the Prophets Masjid.
The prophet ﷺ first arrived in the city of Medina on a camel, and he continued riding into the city until the camel stopped. He said this is where his masjid would be built and asked who owned the land. He found out it was owned by two orphans from Banu Najjar. He asked what price they would sell the land for, but when the two orphans found out it was to build a mosque, they wanted to give it away for free. The prophet ﷺ refused to accept it as a gift and insisted they give him a price; Abu Ayyub al-Ansari then paid the amount.
Masjid an-Nabawi was originally 35 meters long and 30 meters wide. The walls were 3 meters tall, and the ceiling was raised to 2 meters tall. The masjid was made of unbaked mud bricks with pillars made of the trunks of palm trees and a partial roof made of date palm leaves and mud. There was also a section at the back end of the masjid called al-Suffah, or al-Ẓullah "the shade." This was for the homeless or unmarried companions who did not have relatives in Medina. They would stay while also mainly learning the Quran and the teachings of the prophet ﷺ. Three doors were also added to the masjid on the south, west, and east sides.
At first, there was no mimbar (pulpit) in the masjid, so the prophet ﷺ would just lean on a palm tree while speaking. At some point, the standing began giving him a hard time, so he asked one of the companions to build something for him to sit on while he spoke to the companions.
The original masjid was facing Masjid al-Aqsa, as this was the original qibla (prayer direction), but when Allah revealed in Surah al-Baqarah 143–144 that the new qibla would be the Sacred House (Makkah), they had to make some minor changes to the masjid. Al-Suffah was moved along the northern wall, the entrance from the north was closed off with stones and mud plaster, and a door portal was opened in the northern wall where the Suffah was originally placed.
The first expansion occurred in the year 7 Hijri, or 629 CE. This expansion increased the total area of the masjid to about 2200 square meters, and the height of the walls was increased to about 3.6 meters. The masjid was extended to the north, east, and west, with each side measuring about 47 meters. Similar to before, the foundation was laid with stones, and the walls were made of unbaked mud bricks. The columns were still made of palm trees, and the roof was covered by leaves and branches of palm trees. Around the same time, a companion of the prophet ﷺ, Tamim al-Dari, brought an oil lamp from Syria, and it started to be used to lighten the masjid. The prophet ﷺ praised al-Dari for his service to the community.
The next expansion occurred at the time of Umar ibn al-Khattab (RA) in the year 17 hijri. As the number of Muslims increased, the people of Medina asked Umar to expand the masjid. More land was bought from the people of Medina, and some land was donated in order to expand the masjid. The masjid was 70 meters long and 60 meters wide. The roof was also raised to five and a half meters tall. More doors were added, and a new section outside the mosque was made for those who wanted to engage in conversation and poetry.
Another expansion was made at the time of Uthman ibn Affan (RA) in the year 29 hijri, when the masjid was extended by 5 meters in the north, west, and south. The building was constructed with decorative stones, and lime mortar was used as construction material. The roof was replaced with teak wood, and the columns were made of decorative stones, which were hollow inside. Iron bars and molten lead were put inside the columns to reinforce them.
The masjid continued to undergo renovations and expansions until 2012, when King Abdullah laid the foundation stone to expand the mosque so it would be able to accommodate two million worshippers once the project was completed. The following expansion dates are listed here:
- 712 CE (88 Hijri): Expansion by Waleed bin Abdul Malik
- 785 CE (161 Hijri): Expansion by Abdullah bin Asim bin Omar bin Abdul Aziz
- 1250–1481 CE (886 Hijri): Mamluk Expansions
- 1850 CE (886 Hijri): Expansion by Sultan ‘Abd al-Majid
- 1948 CE (1368 Hijri): First Saudi Expansion
- 1973 CE (1393 Hijri): Western Extension
- 1988 CE (1410 Hijri): Second Saudi Expansion
- 2012 CE (1433 Hijri): Third Saudi Expansion
The following narrations are things the prophet ﷺ said about Medina, the people of Medina, and masjid an-Nabawi:
The reward for a pray at Masjid an-Nabawi:
Abu Huraira (Allah be pleased with him) reported Allah's Messenger (ﷺ) as saying: Prayer in my mosque is more excellent than a thousand prayers observed in other mosques except the Masjid al- Haram.
Sahih Muslim 1394, Sahih al-Bukhari 1190
Similar to masjid an-Nabawi, Masjid al-Quba also holds a high place in Islam:
(Sahl) bin Hunaif said: “The Messenger of Allah (ﷺ) said: ‘Whoever purifies himself in his house, then comes to the Quba’ Mosque and offers one prayer therein, will have a reward like that for ‘Umrah.”
Sunan Ibn Majah 1412
Ad-Dajjal (Antichrist) when he sees Medina:
Narrated Anas bin Malik: The Prophet (ﷺ) said, "Ad-Dajjal will come and encamp at a place close to Medina and then Medina will shake thrice whereupon every Kafir (disbeliever) and hypocrite will go out (of Medina) towards him."
Sahih al-Bukhari 7124
Narrated Abu Bakra: The Prophet (ﷺ) said, "The terror caused by Al-Masih Ad-Dajjal will not enter Medina and at that time Medina will have seven gates and there will be two angels at each gate guarding them."
Sahih al-Bukhari 1879
The Prophet ﷺ love for Medina
Narrated Anas: Whenever the Prophet (ﷺ) returned from a journey and observed the walls of Medina, he would make his Mount go fast, and if he was on an animal (i.e. a horse), he would make it gallop because of his love for Medina.
Sahih al-Bukhari 1886