The Quraish thought of getting rid of the Prophet (peace and blessings of Allah be upon him), by choosing a young man from each tribe and waiting for the Prophet (peace and blessings of Allah be upon him), to go out to pray and then they would beat him with the blow of one man and thus his blood would be dispersed among the tribes and the relatives of the Prophet could not ask for retribution. So Jibril came and ordered the Prophet (peace and blessings of Allah be upon him) to migrate to Medina, so the Prophet went out after he made Ali ibn Abi Talib in his bed, and then the Prophet (peace and blessings of Allah be upon him) went out, penetrated their ranks and took a handful of the dust and he scattered it on their heads, and Allah took their eyes away from him so that they would not see him, and He recited it:,,(and have placed a barrier before them and a barrier behind them and covered them ˹all˺ up, so they fail to see ˹the truth˺.) . The Prophet (peace and blessings of Allah be upon him) and Abu Bakr rose and stayed in Ghar Thor for three days hiding from the Quraysh that was sent in their wake, after which the Prophet (peace and blessings of Allah be upon him) arrived in Medina and its people welcomed him and he built in it his mosque and house.
فكرت قريش في التخلص من النبي صلى الله عليه وسلم، بأن يجمعوا شاب من كل قبيلة وينتظرون الرسول صلى الله عليه، عند خروجه للصلاة و يضربوه ضربة رجل واحد وبذلك يتفرق دمه بين القبائل ولا يستطيع أهل الرسول طلب القصاص. لذا جاء جبريل وأمر الرسول صلى الله عليه للهجرة إلى المدينة ، فخرج الرسول بعد أن جعل علي بن ابي طالب في فراشه ، ثم خرج الرسول صلى الله عليه وسلم، واخترق صفوفهم وأخذ حفنة من التراب وجعلها علي رؤوسهم، وقد اخذ الله ابصارهم عنه فلا يرونه، وهو يتلو:( وجعلنا من بين أيديهم سدا ومن خلفهم سدا فأغشيناهم فهم لا يبصرون) يس:9. وقام الرسول صلى الله عليه ومعه أبو بكر ومكثا في غار ثور لمدة ثلاثة أيام متخفين من قريش التي أرسلت في أعقابهم ، بعد ذلك وصل الرسول صلى الله عليه إلى المدينة فتحناه أهلها بالرحب وبنى فيها مسجده ومنزله.