Published on

The Migration to Medina: The Hijra Explained

Authors
  • Ahmad
    Name
    Ahmad
    Role
    Senior Marketing Manager, Islamic education โ€ข DeenUp

ุจูุณู’ู…ู ุงู„ู„ู‡ู ุงู„ุฑูŽู‘ุญู’ู…ูฐู†ู ุงู„ุฑูŽู‘ุญููŠู’ู…ู

In the name of God, the Most Gracious, the Most Merciful.

A desert path at dawn representing the migration to Medina โ€” the Hijra of the Prophet Muhammad

Every major turning point in history has a before and an after. For Muslims, the migration to Medina โ€” known as the Hijra (ู‡ูุฌู’ุฑูŽุฉ) โ€” is that line. It divides the early Meccan period from the Medinan era of Islam. It is the moment from which Muslims count their years. And it is a story not primarily about geography but about what it means to trust Allah completely when everything around you is uncertain.

What Was the Migration to Medina

The year was 622 CE, the thirteenth year of prophethood. The Muslims had endured over a decade of persecution in Mecca: boycotts, torture, the death of loved ones. The Prophet (๏ทบ) had just passed through what scholars call Aam al-Huzn (ุนูŽุงู…ู ุงู„ู’ุญูุฒู’ู†) โ€” the Year of Grief โ€” in which both his wife Khadijah and his uncle Abu Talib died within weeks of each other. Yet the opposition was intensifying, not relenting.

Then two delegations from Yathrib (later named al-Madinah al-Munawwarah, ุงู„ู…ุฏูŠู†ุฉ ุงู„ู…ู†ูˆุฑุฉ โ€” "the Radiant City") came to the Prophet at Mecca and pledged to protect him and his community as they would protect their own families. These pledges, known as the First and Second Baya'ah of Aqabah, opened a path that Allah had been preparing.

Allah's permission came: migrate. But the Quraysh of Mecca, realizing what was happening, sent men to the Prophet's house with instructions to kill him before dawn. The Prophet (๏ทบ) asked Ali ibn Abi Talib to sleep in his bed to delay detection, and then left quietly into the night with Abu Bakr As-Siddiq โ€” his closest companion and the one who had prepared two camels and provisions months in advance for this exact moment.

The Cave of Thawr

Rather than heading directly north toward Medina, the two men went south โ€” the opposite direction โ€” to confuse any pursuers. They sheltered in the Cave of Thawr for three nights, with Abu Bakr's son Abdullah bringing them news of the Quraysh's movements, and his daughter Asma bringing food, famously tearing her belt in two to tie the provisions (earning her the title Dhat an-Nitaqayn, ุฐูŽุงุชู ุงู„ู†ูู‘ุทูŽุงู‚ูŽูŠู’ู† โ€” "the one of two belts").

At one point, Quraysh trackers came directly to the cave's entrance. Abu Bakr whispered his fear. And it is here that the Quran records the Prophet's words, preserved forever in Surah At-Tawbah 9:40:

ุฅูุฐู’ ูŠูŽู‚ููˆู„ู ู„ูุตูŽุงุญูุจูู‡ู ู„ูŽุง ุชูŽุญู’ุฒูŽู†ู’ ุฅูู†ูŽู‘ ุงู„ู„ูŽู‘ู‡ูŽ ู…ูŽุนูŽู†ูŽุง

"When he said to his companion: Do not grieve; indeed Allah is with us." (Surah At-Tawbah, 9:40)

Those words โ€” la tahzan, innallaha maana โ€” are one of the most comforting lines in the Quran. Spoken in a cave, surrounded by enemies, with nowhere obvious to go, they carry an authority that comes only from genuine certainty. Not bravado. Not denial of danger. But a settled knowledge that Allah's presence is real.

The Journey and Arrival

After three nights, the Prophet (๏ทบ) and Abu Bakr set out for Medina, guided by a hired non-Muslim tracker named Abdullah ibn Urayqit, taking an unfamiliar coastal route. The journey covered roughly 400 kilometres and took approximately two weeks.

They stopped first at Quba, on the outskirts of Medina, where the Prophet (๏ทบ) spent several days and built what became the first mosque in Islamic history โ€” Masjid Quba. He then continued to Medina proper, arriving on a Friday.

The welcome was unlike anything recorded in history before it. Men, women, and children came out singing and calling โ€” "tala'a al-badru alayna" (ุทูŽู„ูŽุนูŽ ุงู„ู’ุจูŽุฏู’ุฑู ุนูŽู„ูŽูŠู’ู†ูŽุง) โ€” "the full moon has risen over us." The Ansar (ุงู„ู’ุฃูŽู†ู’ุตูŽุงุฑ, "the Helpers") of Medina had been waiting.

The Brotherhood: A Model for Community

One of the first things the Prophet (๏ทบ) did after arriving in Medina was establish the muakhah (ู…ูุคูŽุงุฎูŽุงุฉ) โ€” the formal brotherhood between the Muhajirun (ุงู„ู’ู…ูู‡ูŽุงุฌูุฑููˆู†, those who had migrated) and the Ansar (the Medinan hosts). Each Muhajir was paired with an Ansari brother. The Ansar offered to share their wealth, their land, and their homes. Some even offered to divorce one of their wives so the Muhajir brother could marry her.

The Quran describes the Ansar's disposition in Surah Al-Hashr 59:9:

ูˆูŽูŠูุคู’ุซูุฑููˆู†ูŽ ุนูŽู„ูŽู‰ ุฃูŽู†ู’ููุณูู‡ูู…ู’ ูˆูŽู„ูŽูˆู’ ูƒูŽุงู†ูŽ ุจูู‡ูู…ู’ ุฎูŽุตูŽุงุตูŽุฉูŒ

"They prefer others over themselves, even if they are in need themselves." (Surah Al-Hashr, 59:9)

This ithar (ุฅููŠุซูŽุงุฑ) โ€” preferring others over yourself โ€” is one of the highest qualities Islam teaches. The Ansar embodied it completely. Their example stands as a permanent challenge: what would it cost you to genuinely help a Muslim brother or sister rebuild their life?

For more on the companions who made this possible, the broader story of the Sahaba and their sacrifices shows how the migration shaped an entire generation of Muslims into the finest community the world has seen.

Why the Migration to Medina Still Matters

Muslims today rarely face the physical displacement the early community endured. But the Hijra teaches something that applies in every era: choosing Allah can require leaving comfort behind.

The Prophet (๏ทบ) left his birthplace, the city he loved deeply, the graves of his family. The companions left their livelihoods, businesses, and property โ€” often confiscated by the Quraysh the moment they departed. Migration was not a painless strategic move. It was a sacrifice undertaken because the alternative โ€” compromising their faith โ€” was not acceptable.

The Prophet (๏ทบ) later said: "O Allah, make Medina as beloved to us as You made Mecca beloved, or even more beloved." (Sahih Bukhari 1889). This dua reveals something important: love for a place, for a home, is not a weakness. But when that love conflicts with your commitment to Allah, the hijra โ€” the internal act of leaving behind what pulls you away from Him โ€” becomes an ongoing practice, not a one-time historical event.

This is why the famous hadith that opens Sahih Bukhari is so fitting as a foundation: "Actions are by intentions, and every person gets what they intended. Whoever migrates for the sake of Allah and His Messenger, his migration is to Allah and His Messenger." (Sahih Bukhari 1, Sahih Muslim 1907)

The Hijra was about niyyah (ู†ููŠูŽู‘ุฉ) โ€” pure intention โ€” before it was about movement.

Understanding the Hijra also illuminates the spiritual journey that preceded it. The revelation at the Cave of Hira began the prophetic mission, and the Night of Isra and Miraj came just before the migration โ€” gifting the ummah with the five daily prayers as a source of strength for the trials ahead.

How to Carry the Hijra Into Your Daily Life

The Hijra is not just history to admire โ€” it is a model for how Muslims navigate difficulty.

1. Make your niyyah pure before every act of worship. The Prophet's migration was an action in the world, but its value came from the intention behind it. Before your next salah, pause and consciously orient your heart toward Allah. This is the Hijra in miniature โ€” pulling your attention from the world and placing it with your Lord.

2. Identify what you need to "migrate" from. Every Muslim has habits, environments, or thought patterns that work against their faith. The Hijra is an invitation to be honest about what you are holding onto that is pulling you away from Allah โ€” and to take the first step of leaving it. Not dramatically, but deliberately.

3. Practice ithar โ€” preferring others. The Ansar's generosity was the Hijra's fruit. Look for one concrete way this week to prefer your Muslim brother or sister over yourself: your time, your attention, your resources. It does not need to be large to be real.

4. Anchor your mornings in remembrance. The Prophet arrived in Medina and immediately built a mosque โ€” a place of prayer. For building the daily habit of morning remembrance that keeps your compass oriented, DeenBack's morning dua routine offers a practical structure that mirrors the rhythm of consistent spiritual anchoring the Prophet established in Medina.

5. Build genuine community. The muakhah was not casual friendship. It was a structured, committed relationship with shared responsibility. Invest in real relationships with Muslim brothers and sisters. Show up for them. The Demi Manifest guide on patience through hardship reflects on what it means to stay present with others when the path is difficult โ€” exactly what the Ansar modeled.

Build daily habits rooted in the prophetic example

DeenUp helps you track your Islamic practices, receive daily Quranic reminders, and stay connected to the teachings that shaped the first Muslim community in Medina.

Download DeenUp โ€” Free on iOS

Signs the Hijra Is Taking Root in Your Life

Growth after reflecting on the Hijra is not always dramatic. It tends to show in small, steady changes:

  • You notice yourself pausing to check your niyyah before acts of worship or generosity
  • Comfort feels less like a right and more like something held loosely
  • You find genuine satisfaction in giving to others rather than protecting what is yours
  • Difficulty no longer feels like evidence that Allah has abandoned you โ€” you remember the cave
  • You feel drawn to invest in community and in Muslim relationships, not just consume from them

These are not achievements to announce. They are the quiet marks of a heart that has started to understand what the Hijra actually required and offered.

Common Questions About the Migration to Medina

Was the migration to Medina obligatory for all Muslims? The early waves of migration were voluntary, though many who could migrate were encouraged to do so. Scholars distinguish between migration that is obligatory (when a Muslim cannot practice their faith in their current location) and migration that is recommended (seeking a better environment for faith). The specific Meccan migration was a unique historical circumstance, but the principle of prioritizing conditions that allow faith to flourish applies broadly.

What happened to the property the Muhajirun left behind? Most of it was confiscated by the Quraysh. The migrants arrived in Medina with little more than what they could carry. This is part of why the Ansar's generosity was so extraordinary โ€” the Muhajirun were genuinely destitute, and the Ansar treated them as family.

Did the Prophet (๏ทบ) ever return to Mecca? Yes. The Prophet returned to Mecca several times after the migration โ€” most significantly during the conquest of Mecca in 8 AH (630 CE), when he entered the city that had driven him out, this time at the head of 10,000 Muslims, and declared a general amnesty. That story is one of the most remarkable displays of mercy in recorded history.

Is the Hijra the beginning of the Islamic calendar? Yes. Umar ibn al-Khattab, during his caliphate, established the Hijri calendar beginning with the year of the migration. The Islamic calendar is lunar, with twelve months, and the year 622 CE corresponds to 1 AH (After Hijra). Understanding the Islamic year structure helps Muslims track the sacred seasons of their faith.

Closing: The Journey Is Still Happening

The migration to Medina ended in 622 CE. The inner migration โ€” al-Hijra al-Batin (ุงู„ู‡ูุฌู’ุฑูŽุฉู ุงู„ุจูŽุงุทูู†ูŽุฉ) โ€” never ends. Every time a Muslim chooses Allah over comfort, chooses honesty over convenience, chooses community over isolation, they are making a hijra.

The Prophet (๏ทบ) defined it this way: "The true emigrant (muhajir) is the one who leaves behind what Allah has forbidden." (Sahih Bukhari 10, narrated by Abdullah ibn Amr). The Cave of Thawr and the desert route to Medina are history. But the disposition โ€” trust in Allah, purity of intention, willingness to sacrifice comfort for what is true โ€” that is as available to you today as it was to the Prophet's companions fourteen centuries ago.

For a full portrait of the Prophet Muhammad (๏ทบ), the Hijra sits at the center โ€” the hinge on which his entire prophetic mission turned from seed to tree.

Reconnect with the prophetic example every day

DeenUp sends daily Quranic verses, authenticated duas, and Islamic habit reminders โ€” tools for the inner migration that the Prophet described as the truest form of the Hijra.

Download DeenUp โ€” Free on iOS

Frequently Asked Questions

What was the Hijra in Islam?

The Hijra (ู‡ูุฌู’ุฑูŽุฉ) was the migration of Prophet Muhammad (๏ทบ) and his companions from Mecca to Medina in 622 CE. It marks the beginning of the Islamic calendar and the moment the Muslim community transitioned from a persecuted minority to a community with a homeland.

Why did the Muslims migrate to Medina?

The persecution of Muslims by the Quraysh had reached a critical point, with many believers facing death or forced apostasy. When the people of Yathrib pledged their protection and support, Allah granted permission to migrate northward.

Who accompanied the Prophet during the migration to Medina?

Abu Bakr As-Siddiq was the Prophet's companion on the migration itself. Most of the Muslim community had already migrated in earlier waves. The Prophet and Abu Bakr hid together in the Cave of Thawr for three nights before completing the journey.

Why does the Islamic calendar begin with the Hijra?

Umar ibn al-Khattab designated the year of the Hijra as Year 1 of the Islamic calendar during his caliphate. The migration represented the birth of the Muslim community as a functioning, free society โ€” the foundational moment of the ummah.

What is the significance of the Brotherhood established in Medina?

After arriving in Medina, the Prophet established the muakhah โ€” a formal brotherhood pairing each Muhajir (migrant from Mecca) with an Ansari (Medinan host). This bond was so deep that initially Ansar shared their wealth and homes with their Muhajir brothers.