Home / History
Fourteen centuriesHistory of Medina
Medina's recorded story runs from an agricultural oasis settled by Arab and Jewish tribes to the first capital of the Islamic world and, today, a city of about 1.5 million people.
Yathrib: the oasis before Islam
Long before it was called Medina, the settlement was known as Yathrib — a fertile oasis on the Hejaz plateau, roughly 340 km north of Mecca, watered by wells and seasonal wadis and hemmed in by dark basalt lava fields. By the sixth century CE it was home to the Arab tribes of Aws and Khazraj alongside Jewish tribes including the Banu Qaynuqa, Banu Nadir and Banu Qurayza, who farmed dates and worked as craftsmen and traders. Decades of feuding between Aws and Khazraj left the oasis politically exhausted — one reason its leaders went looking for an outside arbitrator. Read more in Yathrib before Islam.
The Hijrah and the first Islamic state
In 622 CE the Prophet Muhammad and his followers migrated from Mecca to Yathrib — the Hijrah, the event from which the Islamic calendar is counted. The town became Madinat an-Nabi, "the City of the Prophet," soon shortened to al-Madinah. Within months the community agreed the Constitution of Medina, a written pact defining the mutual obligations of the Muslim emigrants, the local Ansar and the Jewish tribes — often described as one of the earliest written constitutions.
The decade that followed shaped Islam itself. The direction of prayer changed from Jerusalem to Mecca in 624 CE, an event commemorated at Masjid al-Qiblatayn. The city defended itself at the Battle of Uhud (625 CE) and the Battle of the Trench (627 CE). The Prophet died in Medina in 632 CE and was buried in the chamber of his wife Aisha, a spot now enclosed within Al-Masjid an-Nabawi beneath the Green Dome.
Capital of the caliphate
Medina served as the capital of the Muslim state under the first three Rashidun caliphs — Abu Bakr, Umar and Uthman — while Muslim rule expanded across Arabia, the Levant, Egypt and Persia. Ali, the fourth caliph, moved the seat of government to Kufa in 656 CE, and political power never returned to Medina. The city instead became a centre of scholarship: Malik ibn Anas, founder of the Maliki school of law, taught here in the eighth century, and his Muwatta reflects the practice of the people of Medina.
From caliphates to the Ottomans
Under the Umayyads, Abbasids, Mamluks and finally the Ottomans, Medina was governed as part of the Hejaz, its prestige tied to the Prophet's Mosque, which successive rulers enlarged and embellished. The dome over the Prophet's tomb was first built in 1279 CE and painted its famous green in 1837. In 1908 the Ottomans completed the Hejaz Railway from Damascus, cutting the pilgrim journey from weeks to days; its Medina terminus at Al-Anbariya still stands as a museum. The line was crippled during the Arab Revolt of World War I and never restored south of Jordan.
The Saudi era
Medina came under the rule of Abdulaziz Ibn Saud in 1925 and became part of the Kingdom of Saudi Arabia, proclaimed in 1932. The twentieth and twenty-first centuries brought successive expansions of the Prophet's Mosque — the largest, from the 1980s onward, multiplied its capacity many times over — along with an international airport, universities including the Islamic University of Medina (founded 1961), and the Haramain high-speed railway (2018) linking the city to Jeddah and Mecca at up to 300 km/h. Under Vision 2030 the city continues to redevelop its central district and the pedestrian corridor toward Quba Mosque.
Timeline at a glance
| Year | Event |
|---|---|
| 622 CE / 1 AH | The Hijrah; Yathrib becomes the City of the Prophet |
| 624 CE | Change of qibla from Jerusalem to Mecca |
| 625 CE | Battle of Uhud |
| 627 CE | Battle of the Trench |
| 632 CE | Death and burial of the Prophet Muhammad in Medina |
| 632–656 CE | Medina is capital under Abu Bakr, Umar and Uthman |
| 1279 CE | First dome built over the Prophet's tomb |
| 1837 CE | Dome painted green |
| 1908 CE | Hejaz Railway reaches Medina |
| 1925 CE | Medina joins the emerging Saudi state |
| 2018 CE | Haramain high-speed railway opens |
Continue with the guide to the Prophet's Mosque or see where these events took place on the city map.