The Hijrah to Madinah: a timeline from the sources

Quick answer: The Hijrah was the move of the Prophet Muhammad ﷺ from Makkah to Madinah in 622 CE, after the people of Yathrib pledged to protect him. He left at night with Abu Bakr (may Allah be pleased with him), sheltered for three nights in a cave on Mount Thawr, and reached Quba on the edge of Madinah in Rabi’ al-Awwal. The outline is agreed; the exact days and several well-known details are reported with differences.

Why Madinah: the pledges at al-Aqabah

Britannica describes the Hijrah as a migration, upon invitation, from Makkah to Yathrib (Madinah) in 622 CE, made to escape persecution. The invitation had been prepared over two pilgrimage seasons at a pass near Mina called al-Aqabah.

The Madain Project places the two pledges in 621 CE and 622 CE. In the second, 73 men and 2 women from the Aws and Khazraj tribes met the Prophet ﷺ in secret and committed to defend him as they would their own kin. He asked them to appoint twelve naqibs (representatives); Islam.wiki counts nine from the Khazraj and three from the Aws. The sira tradition calls this second pledge bay’at al-harb, the pledge of war.

Makkah was not the first place Muslims had left. Wikipedia’s article on the persecution of Muslims by the Meccans notes that two migrations took place before the one to Madinah, the first to Abyssinia around 613 or 614 CE, and that some of those exiles stayed there until 628.

How the story has reached us

The early biography of Ibn Ishaq did not survive in its original form. Wikipedia’s entry on Ibn Ishaq explains that Ibn Hisham’s edited version is the one that survives in copies, and that the material in Ibn Hisham and al-Tabari is “virtually the same”, according to the scholar Fred Donner. Both are classical sira and history works, and both are read alongside the hadith collections.

Sahih al-Bukhari holds a detailed first-hand report of the departure, a narration of Aisha (may Allah be pleased with her) numbered 3905 on sunnah.com. IslamQA points to this report as the source for the three nights in the cave. Where this article rests on Bukhari, it says so. Where it rests on the sira literature, it says “reported”.

Timeline of the Hijrah

The Julian dates below are approximate. Modern writers convert the lunar dates backwards, and the sources don’t always agree on the day.

When (approx.) Event Status in the sources
621 CE, pilgrimage season First pledge at al-Aqabah by twelve men from Yathrib Agreed
Dhul-Hijjah, 622 CE Second pledge at al-Aqabah; twelve naqibs appointed Agreed; the year of prophethood is counted as 12 or 13 by different writers
Summer to early autumn 622 CE Muslims leave Makkah in small groups for Yathrib Agreed
Safar, 1 AH (about 9 September 622) The Prophet ﷺ and Abu Bakr leave at night and enter the cave on Mount Thawr Three nights agreed (Bukhari 3905); the day of departure is given as 26 or 27 Safar
Early Rabi’ al-Awwal They leave the cave with a hired guide and take a coastal route Agreed in outline
8 or 12 Rabi’ al-Awwal (about 20 to 24 September 622) Arrival at Quba; the first mosque is founded The day differs between sources
A few days later Entry into Madinah; lodging with Abu Ayyub (may Allah be pleased with him); building of the mosque Agreed in outline; length of stay at Quba reported variously
1 Muharram 1 AH (16 July 622, Julian) First day of the Hijri year, counted backwards later Agreed as a calendar convention
16 to 17 AH (about 637 to 638 CE) The Hijri calendar is set up under Umar (may Allah be pleased with him) Reports differ (see the calendar section)

For the departure day, Simple English Wikipedia’s chronology gives 26 Safar and 8 Rabi’ al-Awwal for Quba, while Qissah gives 27 Safar for departure and the same 8 Rabi’ al-Awwal for arrival. The infaq.org.au article on the Hijri calendar, which cites al-Tabari, treats 12 Rabi’ al-Awwal as the day of arrival.

The night of departure and the cave of Thawr

By the time of the departure, nearly all the Muslims of Makkah had gone. Wikipedia’s article on Muhammad in Medina relates that the Prophet ﷺ had told his followers to emigrate, and that the Quraysh, alarmed at their leaving, plotted against his life. In that account he asked Ali (may Allah be pleased with him) to sleep in his bed. This detail is reported in the sira tradition.

Preparation had begun well before. Oursunnah, summarising the Bukhari report, says Abu Bakr had fed two camels for four months in readiness. The report adds that a skilled guide was hired, and that the camels would be brought to the cave after three nights. According to Dr Casim Avci’s account on lastprophet.info, the guide, Abdullah ibn Uraiqit, was an idolater known to be trustworthy.

The two did not ride north towards Yathrib, where the Quraysh would look first. Medinacity.net notes they went south and hid on Mount Thawr while search parties scoured the roads. Each night Abu Bakr’s son Abdullah (may Allah be pleased with him) listened to the talk of Makkah and brought the news to the cave, Wikipedia’s entry on Abdullah ibn Abi Bakr records. One piece of that news was the Quraysh’s reward of 100 camels for the Prophet ﷺ.

The Quran refers to this moment in Surah al-Tawbah.

إِلَّا تَنصُرُوهُ فَقَدْ نَصَرَهُ ٱللَّهُ إِذْ أَخْرَجَهُ ٱلَّذِينَ كَفَرُوا۟ ثَانِىَ ٱثْنَيْنِ إِذْ هُمَا فِى ٱلْغَارِ إِذْ يَقُولُ لِصَٰحِبِهِۦ لَا تَحْزَنْ إِنَّ ٱللَّهَ مَعَنَا ۖ فَأَنزَلَ ٱللَّهُ سَكِينَتَهُۥ عَلَيْهِ وَأَيَّدَهُۥ بِجُنُودٍۢ لَّمْ تَرَوْهَا وَجَعَلَ كَلِمَةَ ٱلَّذِينَ كَفَرُوا۟ ٱلسُّفْلَىٰ ۗ وَكَلِمَةُ ٱللَّهِ هِىَ ٱلْعُلْيَا ۗ وَٱللَّهُ عَزِيزٌ حَكِيمٌ

If you do not aid the Prophet – Allah has already aided him when those who disbelieved had driven him out [of Makkah] as one of two, when they were in the cave and he said to his companion, "Do not grieve; indeed Allah is with us." And Allah sent down his tranquillity upon him and supported him with angels you did not see and made the word of those who disbelieved the lowest, while the word of Allah – that is the highest. And Allah is Exalted in Might and Wise.

The verse names no one, but the classical commentary reads “his companion” as Abu Bakr. Tafsir al-Jalalayn, as reproduced on quranhadits.com, identifies the companion as Abu Bakr and the cave as a breach in the mountain called Thawr.

Sahih al-Bukhari also reports what Abu Bakr said of that hour.

مَا ظَنُّكَ يَا أَبَا بَكْرٍ بِاثْنَيْنِ اللَّهُ ثَالِثُهُمَا

Narrated Abu Bakr:I said to the Prophet (ﷺ) while I was in the Cave. "If any of them should look under his feet, he would see us." He said, "O Abu Bakr! What do you think of two (persons) the third of whom is Allah?

The famous story of a spider’s web across the entrance and a nest at its mouth comes from later tradition. Human Appeal’s account frames it as “according to Islamic tradition”. It isn’t in the Bukhari report cited above, and this article leaves it as tradition.

The road to Quba and into Madinah

On the morning after the third night the guide brought the camels. The two travelled down towards the coast on a route few caravans used. Wikipedia’s entry on Suraqa ibn Malik (may Allah be pleased with him) says he was among those tempted by the reward; the report is that the search ended and the pursuers turned back.

The Wikipedia article on al-Qaswa says Ibn Hisham’s recension has the Prophet ﷺ riding the camel al-Qaswa north to Madinah by routes chosen to avoid pursuit. Reports of the journey’s length vary, from about 8 days to about a week and a half, and the sources above don’t settle it.

Medinacity.net says he reached Quba, on the southern edge of the oasis, in Rabi’ al-Awwal of that year, around September 622 CE. He stayed several days as a guest of the Banu Amr ibn Awf and laid the foundation of the Quba mosque. Wikipedia’s article on Medina calls it the oldest mosque in Islam. A further account, from Raja Azhar’s blog, says he led the Friday prayer in the valley of Banu Salim on the way into the city.

The entry into Madinah itself is told in the sira with the clans competing to host him. In the Ibn Hisham account, as summarised on Wikipedia, tribal leaders each tried to take hold of al-Qaswa’s reins, and he declined to choose between them. The Seerah Encyclopedia timeline records that he lodged with Abu Ayyub, that Yathrib came to be called al-Madinah, and that the Prophet’s mosque was built.

Abu Bakr’s family came later. According to Wikipedia’s entry on Abdullah ibn Abi Bakr, a few months after the Hijrah he travelled to Madinah with his stepmother Umm Ruman and his sisters Asma and Aisha.

What Madinah became

Britannica says that after arriving, the Prophet ﷺ negotiated the Constitution of Medina with the local clans, which established the Muslim community as a social and political body for the first time. Qissah adds that he joined the Muhajirun (those who migrated) and the Ansar (the helpers of Madinah) in brotherhood.

The details of the Constitution and the brotherhood are discussed at length in the sira and fall outside the scope of this article.

The calendar that grew from the Hijrah

Muslims didn’t count years from the Hijrah during the Prophet’s ﷺ lifetime. Wikipedia’s article on the Hijri era says Umar chose the Hijrah as the epoch for a new Muslim calendar. Britannica gives 639 CE for this. The infaq.org.au article lists reports of 16 AH, 17 AH, and one of 17 or 18 AH; it adds that al-Tabari places it in Rabi’ al-Awwal of 16 AH. The same article says Ali’s advice settled the starting point, with Umar agreeing, and that Ibn Hajar concluded Umar, Uthman and Ali all supported beginning the year in Muharram.

Because the year begins on 1 Muharram, the infaq article points out, the era starts about two months and twelve days before the arrival in Madinah. Counting backwards, 1 Muharram 1 AH falls on 16 July 622 in the Julian calendar. To convert a date yourself, the Hijri converter on this site may help, and the Islamic New Year dates page gives the expected date of the next one.

What the reader can take from the account

  • Planning alongside trust. The Bukhari report describes two camels prepared months ahead, a guide hired for his knowledge of the desert, and news gathered each night. The same account has the words from Surah al-Tawbah said in the cave.
  • Roles for different people. The sources name Abu Bakr as companion, Ali in the bed, Abdullah ibn Abi Bakr as the gatherer of news, and a hired non-Muslim guide. A hard task in these reports was shared among several people.
  • First steps after arriving. Reports place a mosque, a lodging, brotherhood between Muhajirun and Ansar and a written agreement with the clans among the early actions in Madinah.

Sources

Header image: illustration, AI-generated.