DAWAH CODEX GUIDE

The Hijrah: the migration to Madinah

By Dawah Codex · Updated 2026-11-27 · 3 min read

Please note: this is a general educational summary compiled from the sources listed below. It is not a fatwa. For your own situation or for rulings, please ask a qualified scholar.

If you do not aid the Prophet, Allah has already aided him when those who disbelieved had driven him out, as one of two, when they were in the cave.

Qur’an 9:40

Why

After years of persecution in Makkah, and the pledges of al-Aqabah with the people of Yathrib, the Muslims were commanded to migrate.

The journey

The Prophet ﷺ left with Abu Bakr at night, hid in the cave of Thawr for three days, and travelled to Madinah in 622 CE. ʿAli slept in his bed to mislead the Quraysh.

In Madinah

He built the mosque, established brotherhood between the Muhajirun and Ansar, and drew up a charter for the city including Jews and others.

The calendar

ʿUmar fixed the Islamic calendar from this event.

Lessons

Sacrifice for faith, planning with trust in God, and building community.

Sources and scholars

  • The Qur’an 9:40, 8:30
  • Imam al-Bukhari, Sahih al-Bukhari, Book of Manaqib al-Ansar
  • Ibn Hisham, al-Sirah al-Nabawiyyah

Frequently asked questions

What is the Hijri calendar?

A lunar calendar that began with the Hijrah.

Who hosted the Prophet ﷺ?

Abu Ayyub al-Ansari, until the mosque and rooms were built.

← All guides