Prophet Muhammad (pbuh) took advantage of every opportunity to guide the people. On the days when people would come to visit the Kaaba, he would invite the new visitors to Islam.
One day there were a few people from Madinah among the visitors who, upon hearing the attractive sayings of the Prophet (pbuh), accepted his teachings.
When these visitors returned to Madinah they told their friends, relatives, and other people of Madinah about the message which Prophet Muhammad (pbuh) had brought.
The next year, more people came to Makkah from Madinah and after meeting Prophet Muhammad (pbuh), they embraced Islam and invited the Prophet to Madinah so that he could teach them better there and try to spread Islam.
The Prophet accepted this invitation and told the Muslims to migrate to Madinah in small groups. When the enemies of Islam heard about this matter they decided to murder Prophet Muhammad (pbuh) before he could leave Makkah.
Thus, they decided to select forty of their best and most courageous men to sneak into the Prophet's house and murder him. Allah informed the Prophet about their wicked plan, telling him to leave the city in secret.
The Prophet (pbuh) asked Imam Ali (as) to sleep in his bed so that the people would think that it was the Prophet sleeping in his bed and they wouldn't know that he had left the city.
Even though Imam All (P.B.U.H.) knew that the enemies of Islam wanted to kill the Prophet and that if he slept in the Prophet's bed his life would be at stake, he did not hesitate to risk his life to protect the Prophet and Islam.
Prophet Muhammad and his followers reached Madinah safely. They started to spread Islam there. Finally, Islam spread rapidly to many new lands.
In a short time, the Muslims gained control of Makkah. The people came out of their ignorance and bad ways of life by accepting Islam and following its guidance.
The time when the Prophet of Islam left Makkah for Madinah marked the beginning of the Muslim calendar. When we say 1419 Hijrah, it means that 1419 years have passed since the time of the Prophet's flight from Makkah to Madinah.