The short answer
The Hijrah was the migration of the Prophet Muhammad ﷺ and his followers from Makkah to Madinah in 622 CE, after years of persecution. It marked the birth of the first Muslim community with its own life and institutions, which is why the Companions chose it as the starting point of the Islamic (Hijri) calendar.
The detail
Why the Muslims left Makkah
For about thirteen years in Makkah, the Prophet ﷺ called people to worship Allah alone. Many early Muslims, especially the poor and the enslaved, faced mockery, boycott and torture. The Quran recalls how the disbelievers plotted to restrain him, kill him or drive him out, while Allah also planned, and Allah is the best of planners (8:30).
Meanwhile, people from Yathrib, a town to the north, had accepted Islam and pledged to protect the Prophet ﷺ. The Muslims began migrating there quietly in small groups.
The journey
The Prophet ﷺ left last, with his close friend Abu Bakr. They hid for several days in the cave of Thawr while search parties scoured the area. Abu Bakr later recalled seeing the pursuers' feet at the mouth of the cave and fearing they would be seen, and the Prophet ﷺ reassuring him by asking what he thought of two people whose third is Allah. The Quran refers to this moment: when he said to his companion, 'Do not grieve; Allah is with us', and Allah sent down His tranquillity upon him (9:40).
A new beginning in Madinah
Yathrib became known as al-Madinah, 'the City' of the Prophet. There he built the mosque, joined the emigrants (Muhajirun) and the local helpers (Ansar) in brotherhood, and established agreements with the town's communities.
The Hijri calendar
Some years after the Prophet's ﷺ death, during the caliphate of Umar, the Companions needed a common dating system. They chose the year of the Hijrah as year 1, because it marked the beginning of the Muslim community's independent life. The calendar is lunar, with twelve months beginning with Muharram.
Hijrah today
The Prophet ﷺ taught that actions are judged by intentions, and that a person whose migration was for Allah and His Messenger has their migration counted as such. Scholars note that the spiritual meaning of hijrah, leaving behind what Allah dislikes, remains open to every believer.
Primary references
The Quran and hadith this answer rests on, quoted from the stored texts with their references.
From the Quran
Quoted from the stored Quran text with the translation named below each verse.
وَإِذْ يَمْكُرُ بِكَ ٱلَّذِينَ كَفَرُوا۟ لِيُثْبِتُوكَ أَوْ يَقْتُلُوكَ أَوْ يُخْرِجُوكَ ۚ وَيَمْكُرُونَ وَيَمْكُرُ ٱللَّهُ ۖ وَٱللَّهُ خَيْرُ ٱلْمَٰكِرِينَ
And when those who disbelieve plot against thee (O Muhammad) to wound thee fatally, or to kill thee or to drive thee forth; they plot, but Allah (also) plotteth; and Allah is the best of plotters.
إِلَّا تَنصُرُوهُ فَقَدْ نَصَرَهُ ٱللَّهُ إِذْ أَخْرَجَهُ ٱلَّذِينَ كَفَرُوا۟ ثَانِىَ ٱثْنَيْنِ إِذْ هُمَا فِى ٱلْغَارِ إِذْ يَقُولُ لِصَٰحِبِهِۦ لَا تَحْزَنْ إِنَّ ٱللَّهَ مَعَنَا ۖ فَأَنزَلَ ٱللَّهُ سَكِينَتَهُۥ عَلَيْهِ وَأَيَّدَهُۥ بِجُنُودٍۢ لَّمْ تَرَوْهَا وَجَعَلَ كَلِمَةَ ٱلَّذِينَ كَفَرُوا۟ ٱلسُّفْلَىٰ ۗ وَكَلِمَةُ ٱللَّهِ هِىَ ٱلْعُلْيَا ۗ وَٱللَّهُ عَزِيزٌ حَكِيمٌ
If ye help him not, still Allah helped him when those who disbelieve drove him forth, the second of two; when they two were in the cave, when he said unto his comrade: Grieve not. Lo! Allah is with us. Then Allah caused His peace of reassurance to descend upon him and supported him with hosts ye cannot see, and made the word of those who disbelieved the nethermost, while Allah's Word it was that became the uppermost. Allah is Mighty, Wise.
From the hadith
Each hadith is quoted as stored, with its collection, number and the reference and grade the edition gives.
Abu Bakr As-Siddiq (May Allah be pleased with him) said: When Messenger of Allah (ﷺ) and I were in the cave of Thaur and I saw the feet of the polytheists who were above us at the mouth of the cave (on the eve of the Emigration), I submitted: "O Messenger of Allah! If one of them were to look down below his feet, he would see us". He (ﷺ) said, "O Abu Bakr! What do you think of two whose third is Allah"..
Show the Arabic
الثامن: عن أبي بكر الصديق رضي الله عنه عن عبد الله بن عثمان بن عامر بن عمر بن كعب بن سعد بن تيم بن مرة بن كعب بن لؤي بن غالب القرشي التيمي رضي الله عنه - وهو وأبوه وأمه صحابة، رضي الله عنهم- قال: نظرت إلى أقدام المشركين ونحن في الغار وهم على رؤوسنا فقلت يارسول الله لو أن أحدهم نظر تحت قدمية لأبصرنا. فقال: " ما ظنك يا أبا بكر باثنين الله ثالثهما" ((متفق عليه)) .
Actions are judged by intentions
It is narrated on the authority of Amirul Mu'minin, Abu Hafs 'Umar bin al-Khattab (ra) who said: I heard the Messenger of Allah (ﷺ) say: "Actions are (judged) by motives (niyyah), so each man will have what he intended. Thus, he whose migration (hijrah) was to Allah and His Messenger, his migration is to Allah and His Messenger; but he whose migration was for some worldly thing he might gain, or for a wife he might marry, his migration is to that for which he migrated."
Show the Arabic
عَنْ أَمِيرِ الْمُؤْمِنِينَ أَبِي حَفْصٍ عُمَرَ بْنِ الْخَطَّابِ رَضِيَ اللهُ عَنْهُ قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ: " إنَّمَا الْأَعْمَالُ بِالنِّيَّاتِ، وَإِنَّمَا لِكُلِّ امْرِئٍ مَا نَوَى، فَمَنْ كَانَتْ هِجْرَتُهُ إلَى اللَّهِ وَرَسُولِهِ فَهِجْرَتُهُ إلَى اللَّهِ وَرَسُولِهِ، وَمَنْ كَانَتْ هِجْرَتُهُ لِدُنْيَا يُصِيبُهَا أَوْ امْرَأَةٍ يَنْكِحُهَا فَهِجْرَتُهُ إلَى مَا هَاجَرَ إلَيْهِ". رَوَاهُ إِمَامَا الْمُحَدِّثِينَ أَبُو عَبْدِ اللهِ مُحَمَّدُ بنُ إِسْمَاعِيل بن إِبْرَاهِيم بن الْمُغِيرَة بن بَرْدِزبَه الْبُخَارِيُّ الْجُعْفِيُّ [رقم:1]، وَأَبُو الْحُسَيْنِ مُسْلِمٌ بنُ الْحَجَّاج بن مُسْلِم الْقُشَيْرِيُّ النَّيْسَابُورِيُّ [رقم:1907] رَضِيَ اللهُ عَنْهُمَا فِي "صَحِيحَيْهِمَا" اللذَينِ هُمَا أَصَحُّ الْكُتُبِ الْمُصَنَّفَةِ
Further sources
Written for Islamic Portal from the Quran and hadith cited above, with widely accepted historical background from the Seerah.
What scholars say
Historians generally date the Hijrah to 622 CE. Scholars of the Seerah relate the choice of the Hijrah for the calendar to a consultation held by Umar, at which other starting points such as the Prophet's ﷺ birth or the beginning of revelation were also considered. Scholars note that the obligation to emigrate from a land where one cannot practise the religion, and its conditions, is a separate legal question discussed in the books of fiqh.
In practice
- A date written as 1448 AH means the 1448th year after the Hijrah (AH stands for 'Anno Hegirae').
- A person who leaves a harmful environment or habit for Allah's sake is said to be making a personal hijrah.
Common misunderstandings
- 'The Islamic calendar starts from the Prophet's ﷺ birth.' It starts from the Hijrah, not from his birth or the first revelation.
- 'The Hijrah was a flight in defeat.' Muslims see it as a planned, trust-filled step that turned persecution into the foundation of a thriving community.
Check your understanding
Try to explain the answer in two sentences, in your own words, as if to a friend. Then read the short answer again and compare.
Suggested lessons
Courses, lessons and guides that teach this topic step by step.
Review and provenance
- Written by
- Islamic Portal editorial team
- Added
- 10 November 2026
Corrections
No corrections have been needed.
