The migration that gives the Islamic calendar its starting point took place over the course of about two weeks in the summer of 622 CE. The Prophet Muhammad and his companion Abu Bakr left the city of Mecca, traveled south briefly to throw off pursuers, hid for three days in a cave on Mount Thawr, and then went north by camel along the back-country routes to the oasis settlement of Yathrib — which, after their arrival, would take a new name: Madinat al-Nabi, “the City of the Prophet,” shortened to Madina, Medina.
Why they left
Muhammad had been preaching publicly in Mecca for about ten years. The message — that there was only one God, that the idols housed in the Kaaba were nothing, that the rich had obligations to the poor, that a day of judgment was coming — was unacceptable to the Quraysh, the tribal confederation that ran the city. Mecca’s economy depended on the annual pilgrimage to the Kaaba and the trade fairs that surrounded it; a movement that denied the legitimacy of every god whose statue stood in the shrine threatened the city’s revenue and its prestige. Persecution of the early Muslim community had been intermittent but real — boycotts, beatings, the deaths of slaves whose masters tortured them for converting.
In 619 — the Aam al-Huzn, the Year of Sorrow — two of Muhammad’s main protectors died within months of each other: his uncle Abu Talib, whose protection had kept the Quraysh leadership from killing him outright, and his first wife Khadija, the woman to whom he had first told the contents of the revelations. With Abu Talib gone, Muhammad’s standing in the tribal protection system collapsed. The plots to kill him became serious.
The opening came from outside. Yathrib, three hundred miles to the north, was an oasis dominated by two warring Arab tribes — the Aws and the Khazraj — and three Jewish tribes — the Banu Qaynuqa, the Banu Nadir, and the Banu Qurayza. The Arab tribes had fought each other for generations and were exhausted by it. In 620, a small delegation from the Khazraj met Muhammad at Aqaba near Mecca during the pilgrimage season; in 621 a larger group of twelve men met him at the same place and pledged obedience; in 622 a delegation of seventy-three Yathribi Muslims gave the Second Pledge of Aqaba and invited him to come north and serve as the arbiter of the city.
He sent the rest of the community on ahead, in twos and threes, across the spring and summer. By July only Muhammad, Abu Bakr, and Ali ibn Abi Talib remained in Mecca. The Quraysh, recognizing that the migration was real, agreed on a plot: a young man from each clan would strike together, so that no single clan could be held responsible by the customary law of vengeance.
The night of the migration
The traditional date for Muhammad’s departure is the night of 1 Rabi al-Awwal — equivalent to mid-September 622. The houses of Mecca were watched. He had Ali sleep in his bed, wrapped in his green cloak, to make the watchers think he was still there. He slipped out through the back. By tradition he scattered dust toward the men at the door as he passed and recited a verse from Surah Yasin; the watchers did not see him. He met Abu Bakr at a prearranged spot. They went south rather than north, to throw off the inevitable search, and reached Mount Thawr just outside the city.
The cave on Thawr is a small one, just large enough for two men sitting. They stayed in it for three days. The story attached to it is that a spider built a web across its mouth and a pair of doves nested at the entrance, so that when the Qurayshi search party — guided by an expert tracker — reached the cave, they concluded no one could have entered recently and turned back. Inside, by the Quranic account in Surah At-Tawba 9:40, Abu Bakr was frightened, and Muhammad said: “Do not grieve. God is with us.”
When the search slackened they emerged, met a guide named Abdullah ibn Urayqit who had been hired for the journey, and rode north by an unfrequented route through the western Hijaz. The journey took about eight days. They arrived at the village of Quba, just south of Yathrib, on the twelfth of Rabi al-Awwal — by later reckoning, sometime in late September. There Muhammad founded the first mosque, the Masjid Quba, the building of which is referenced in Surah At-Tawba 9:108 as “the mosque founded on piety from the first day.” Then he rode the last few miles into Yathrib and let his camel stop where it would; it stopped at a date-drying field belonging to two orphan brothers, and on that spot was built the Masjid an-Nabawi, the Prophet’s Mosque, which still stands.
What was founded
What followed within the next year is the political and legal birth of Islam as something more than a preaching movement. The Sahifat al-Madina — the Constitution of Medina — was drafted, an explicit covenant binding the Muslim emigrants from Mecca (Muhajirun), the Yathribi converts (Ansar, “the Helpers”), the remaining pagan Arab tribes of the oasis, and the three Jewish tribes into a single political community, the umma. Each group was guaranteed religious freedom under the document; collective defense was specified; arbitration of disputes was reserved to Muhammad.
The qibla — the direction of prayer — was initially Jerusalem. Sixteen or seventeen months after the migration, by tradition during the noon prayer at the Masjid al-Qiblatayn in Medina, a verse was revealed (Surah Al-Baqarah 2:144) that turned the qibla toward Mecca and the Kaaba. Friday congregational prayer, the call to prayer (adhan), the fast of Ramadan, the zakat poor-tax — all of these took their developed form in Medina in the years immediately following the migration.
The military events that followed — the battle of Badr in 624, the battle of Uhud in 625, the siege of Medina in 627, the treaty of Hudaybiyya in 628, the bloodless reconquest of Mecca in 630 — are inconceivable without the political base the Hijra established. Muhammad died in 632, in Aisha’s apartment off the courtyard of the Prophet’s Mosque. He was buried in the same spot. The successor state — the Caliphate — would within thirty years rule from the Atlantic to the Indus.
Why it still matters
In 638 CE, sixteen years after the migration, the second caliph Umar ibn al-Khattab formalized a Hijri calendar that begins not from Muhammad’s birth, not from the first revelation in 610, and not from his death in 632, but from the year of the migration to Medina. The implication is theological: the founding of the Muslim community as a self-governing entity, not the individual life of the Prophet, is the event from which Islamic time is measured.
The Hijra also fixed a vocabulary. Muhajir — emigrant — is still the word for a Muslim who leaves a place where the practice of the faith is constrained, and it is morally weighted. Ansar — helper — is the title carried by communities that receive such emigrants. The pattern of departure, of refuge, and of re-founding in a new and welcoming land is a recurring template in Islamic political memory.
The dates of the Islamic calendar are still given in AH — Anno Hegirae, “in the year of the Hijra.” The calendar runs about eleven days shorter per year than the solar one and therefore cycles backward through the seasons; the year 1446 AH began in early July 2024 CE.
The two cities at the start and end of the journey — Mecca and Medina — are the Haramayn, the two sanctuaries, the two holiest places in Islam. The road between them, the one Muhammad and Abu Bakr rode in 622, runs about three hundred miles and is now a paved highway used by millions of pilgrims a year.