Later, the people of Yathrib, who spoke to Prophet Muhammad the year prior, had converted to Islam and returned to Prophet Muhammad, promising to support him, and invited him to their city, which Prophet Muhammad agreed to. Prophet Muhammad, peace be upon him, had family in the city of Yathrib and had traveled there with his mother when he was younger right before she passed away. Now that the Muslims had a place to live without persecution, many of the Muslims migrated to Yathrib, which was later named Medina. About one hundred families quietly migrated from Mecca to Medina secretly. Many of the Muslim immigrants that traveled to Abyssinia prior also migrated to Medina. The Prophet, his cousin Ali, and his friend Abu Bakr remained in Mecca for the time being. The Prophet was waiting for instructions from God before migrating.
The idol-worshippers of Mecca feared the growth and power of the Muslims. They saw them as a threat to their religion and began to think of ways to kill Prophet Muhammad, peace be upon him, even though that would go against their laws, as it was unheard of to kill someone of their own blood– especially in the sacred land from Mecca. Each tribe sent one of their young men to the Prophet’s house to kill him. Then Angel Gabriel was sent down to Prophet Muhammad to let him know what the idol-worshippers of Mecca were plotting. Angel Gabriel also informed Prophet Muhammad that he has Allah’s permission to leave Makkah. The enemies of the Prophet surrounded his house, but Allah covered their eyes and blinded them, allowing Prophet Muhammad to escape while reciting Verses from Chapter Yaseen from the Holy Quran. Prophet Muhammad and his companion Abu Bakr fled to a cave named Thor, where they spent 3 days.
The idol-worshippers hired someone to trace the footsteps of Prophet Muhammad to figure out where he went. He led them to the cave that they were in. So, the idol-worshippers sent in their troops to the cave, and Abu Jahl was with them. The Prophet’s companion, Abu Bakr, whispered to Prophet Muhammad that all they needed to do was look down, and they would see them. Then Prophet Muhammad responded, ‘O Abu Bakr, what do you think of two people, Allah is the third of them?’ The idol-worshippers of Mecca failed to find Prophet Muhammad and his companion, so they left and offered anyone that finds Prophet Muhammad and his companion a hundred camels in blood money– if they bring them dead or alive. But Prophet Muhammad and his companion Abu Bakr fled to Medina.
Upon arrival to Medina, Prophet Muhammad’s first task was to build a Mosque called Masjid Quba in the very site where his camel knelt down. It was land owned by two orphans, and Prophet Muhammad purchased the land from them. Prophet Muhammad helped his companions build this Mosque by carrying bricks and stones while reciting Verses of the Holy Quran. With God & the Quran’s Guidance, Prophet Muhammad, peace be upon him, taught and preached the Islamic way of life to his companions in Medina. He was their guide, teacher, judge, consoler, arbitrator, adviser, and father-figure to the new community in Medina.
The migration of the Muslims to Medina is known as ‘The Hijra’ in Arabic and was later adopted as the start of the Muslim calendar. Those who emigrated from Mecca to Medina earned the title of Muhajireen (The Emigrants). The Muslims that were living in Medina and welcomed and supported the Emigrants adopted the title of ‘The Ansar’ (The Helpers). Prophet Muhammad, peace be upon him, made a pact of mutual religious solidarity between both Muslim groups.
Two Arab tribes ruled Medina called The Aws and The Khazraj— who were constantly fighting among themselves for many years, and many of their seniors had died– soon came to peace when Prophet Muhammad entered their city. Prophet Muhammad started to enter into treaties with other tribes living around them. Prophet Muhammad made a pact between all the tribes of Medina, including the Jewish tribes and idol-worshipping tribes living in the area, that they would all support one another in defending the city against an attack. For the first time, the Muslims had their own state.
After about a year and a half after the Muslims migrated to Medina, the Qibla (the direction in which Muslims pray) was changed after Prophet Muhammad, peace be upon him, made a dua (prayer supplication) to Allah, the Glorious, to change the direction from Masjid Al-Aqsa to the Kaaba.