اَلْهِجْرَةُ النَّبَوِيَّة

The Hijrah: The Prophet’s Migration from Makkah to Madinah

622 CE • 1 AH • The Beginning of the Islamic Calendar

At a Glance

📅
Date

September 622 CE, the month of Rabi al-Awwal, 1 AH

👥
Key Figures

The Prophet Muhammad, Abu Bakr (RA), and Ali ibn Abi Talib (RA)

📍
Location

From Makkah to Yathrib, renamed Madinat an-Nabi, about 450 km north

✨
Significance

The birth of the Muslim community and the start of the Hijri calendar

A small caravan of camels crossing a vast desert at dawn
The road from Makkah to Madinah, traveled by night

Background: The Pledges of Yathrib

After the Year of Sorrow, the Prophet began meeting pilgrims who came to Makkah from other towns, inviting them to Islam. Among them were men from Yathrib, an oasis town about 450 kilometers north, torn by long wars between its two Arab tribes, the Aws and the Khazraj. They were looking for someone who could unite them, and they found the message compelling.

Over two pilgrimage seasons, groups of Yathrib’s people met the Prophet secretly at Aqaba, outside Makkah, and pledged themselves to him. The Second Pledge of Aqaba, in 622 CE, was decisive: seventy-three men and women promised to protect the Prophet as they protected their own families, and to receive the Muslims into their city. The Prophet sent his companion Mus’ab ibn Umayr ahead to teach them the Quran. Yathrib was ready. One by one, the Muslims of Makkah began slipping away to the north in small groups.

What Happened

The Night of Departure

The Quraysh watched the Muslims leaving and understood what it meant: a rival community was forming in Yathrib. Their leaders gathered and plotted to kill the Prophet before he could escape, choosing one young man from each clan so that the blame would be shared and Banu Hashim could not take revenge. But Allah informed His Messenger of the plot.

On the night the assassins surrounded his house, the Prophet asked Ali ibn Abi Talib to sleep in his bed, wrapped in his green cloak, and to return the valuables that people had entrusted to him, for even his enemies trusted him with their deposits. Then the Prophet walked out past the waiting men, reciting the opening verses of Surah Ya-Sin, and Allah blinded them to his passing. He went straight to the house of Abu Bakr, and the two of them left Makkah by night.

Three Nights in the Cave of Thawr

Instead of heading north toward Yathrib, the two travelers went south to the Cave of Thawr, a rugged hollow in a mountain a few miles from Makkah, to throw off pursuit. They hid there for three nights. Abu Bakr’s son Abdullah brought them news from the city each evening, his servant Amir ibn Fuhayrah grazed sheep over their tracks to erase them, and Abu Bakr’s daughter Asma brought them food, earning the title “the lady of the two belts” for tearing her waistband to tie the provisions.

The Quraysh offered a bounty of one hundred camels for the Prophet’s capture, and search parties scoured the hills. At one point, the pursuers stood at the very mouth of the cave, and Abu Bakr whispered in fear. The Prophet’s answer is preserved in the Quran itself:

إِذْ يَقُولُ لِصَاحِبِهِ لَا تَحْزَنْ إِنَّ اللَّهَ مَعَنَا

Idh yaqulu lisahibihi la tahzan innallaha ma‘ana.

“When he said to his companion, ‘Do not grieve; indeed Allah is with us.’” (9:40)

جب اس نے اپنے ساتھی سے کہا: غم نہ کرو، بے شک اللہ ہمارے ساتھ ہے۔

The Road North

When the search died down, the Prophet and Abu Bakr set out with a trusted guide, Abdullah ibn Urayqit, who knew the desert tracks. They traveled by little-used paths, resting by day and moving by night. On the way, the horseman Suraqah ibn Malik nearly caught them, drawn by the bounty, but his horse stumbled again and again until he understood this was no ordinary pursuit, and he turned back.

Quba: The First Mosque

After about a week on the road, they reached Quba, a village on the outskirts of Yathrib, on the 8th of Rabi al-Awwal. The Prophet stayed there about two weeks, and during that stay he founded Masjid Quba, the first mosque built in Islam, laying its stones with his own hands. Ali, who had settled the Prophet’s affairs in Makkah and then made the journey on foot, caught up with them at Quba.

Entry into Madinah

The Prophet then rode toward the city, stopping at the settlement of Banu Salim, where he led the first Friday congregational prayer in Muslim history. The people of Yathrib came out in crowds to welcome him. Everyone wanted the honor of hosting him, and each grabbed at his camel’s reins. The Prophet told them to let his camel go, for it was under divine command. The camel, Qaswa, finally knelt at a plot belonging to two orphan boys of the Banu Najjar, Sahl and Suhayl, which the Prophet insisted on buying rather than accepting as a gift.

It was the 12th of Rabi al-Awwal, 1 AH. The Prophet stayed as a guest in the house of Abu Ayyub al-Ansari while the Prophet’s Mosque rose on the purchased land beside it. Yathrib was renamed Madinat an-Nabi, the City of the Prophet, and its people who had sheltered the migrants earned the eternal title of Ansar, the Helpers.

A green oasis with palm trees and a small stone structure at sunrise
The oasis of Quba, home of the first mosque in Islam

Key Figures

  • The Prophet Muhammad: left his home of fifty-three years to build a new community on faith.
  • Abu Bakr as-Siddiq (RA): his companion on the journey, who spent his wealth and risked his life without hesitation.
  • Ali ibn Abi Talib (RA): slept in the Prophet’s bed on the night of danger and returned every entrusted deposit.
  • Asma bint Abi Bakr (RA): carried food to the cave at Thawr, known ever after as “the lady of the two belts.”
  • Abu Ayyub al-Ansari (RA): the host of the Prophet in Madinah during the building of the mosque.

Lessons and Legacy

The Hijrah was not a flight; it was a founding. In Makkah, Islam had been a persecuted message. In Madinah, it became a community, a city, and the seed of a civilization. The Prophet paired each migrant (Muhajir) with a Helper (Ansari) in bonds of brotherhood so strong that they inherited from one another, until the Quran later fixed inheritance among blood kin.

The migration’s importance is stamped into time itself. When Umar ibn al-Khattab later established the Islamic calendar, he chose the year of the Hijrah as its first year, not the year of the Prophet’s birth or the first revelation, because the Hijrah marked the moment Islam moved from survival to establishment. Every date in Islamic history, including the battles and treaties in this Islamic history series, is counted from this journey.

The first acts of the new city set its character: the building of the Prophet’s Mosque, the brotherhood between migrants and Helpers, and the writing of the Charter of Madinah, the remarkable covenant that bound Muslims, Jews, and pagan tribes into one political community.

FAQ

When did the Hijrah take place?

+

The Prophet left Makkah in Safar and arrived in Madinah on the 12th of Rabi al-Awwal, in September 622 CE. This year became year 1 of the Islamic Hijri calendar, established later in the caliphate of Umar ibn al-Khattab.

Why is it called the Hijrah?

+

Hijrah means migration, specifically migration for the sake of Allah. The Muslims left their homes, wealth, and tribe in Makkah to practice their faith freely in Madinah, and the Quran honors those who “migrated for the cause of Allah” throughout its pages.

Who stayed in the Prophet’s bed on the night he left?

+

Ali ibn Abi Talib (RA), the Prophet’s young cousin. He slept in the Prophet’s bed wrapped in his cloak to deceive the assassins, and the next morning he returned all the valuables the Meccans had entrusted to the Prophet before joining the migration himself.

What happened in the Cave of Thawr?

+

The Prophet and Abu Bakr hid in the Cave of Thawr, south of Makkah, for three nights while search parties hunted them for a bounty of one hundred camels. Abdullah ibn Abi Bakr brought news, Amir ibn Fuhayrah erased their tracks, and Asma brought food, until the pursuit ended and they set out north.

What was the first mosque built in Islam?

+

Masjid Quba, built during the Prophet’s stay of about two weeks at Quba on the outskirts of Madinah. The Prophet laid its stones with his own hands, and the Quran praises it as “a mosque founded on righteousness from the first day” (9:108).

Final Thoughts

“Do not grieve; indeed Allah is with us.” Those words, spoken in a dark cave with pursuers at the mouth, carried the Prophet to a new city and a new era. The Hijrah teaches us that beginnings often look like endings: leaving home, losing comfort, walking into the unknown. But the One who was with two men in a cave was with a whole community in Madinah, and within a decade that community would change the world. Every Hijri year we count is a reminder that faith, trust, and a night journey can remake history.

Continue Reading

See how the new city was governed in the Constitution of Madinah, or return to the Islamic history timeline to explore all ten chapters of the early seerah.

Share this page