Prophet Muhammud had emigrated to Yathrib under the invitation of group of young men from one of the Arab tribes of Medina ( Aus or khazraj ) who met Prophet Muhummud P.B.U.H preaching at a trade fair at Mecca and immediately understood this was the last Messiah and Prophet that the Jews kept them threatening many times of using his leadership and belittling them in the future and so these Youth decided and dived into Islam right away within a hour of hearing Prophet Muhammad P.B.U.H speech with no hesitation whatever of he being the last Prophet with his wonderful Quran verses . They did not wait to witness any miracles among the 100s of miracles of the Prophet that were already witnessed by the pagans of Mecca for the past 12 years. They did not stop with it but cut short their visit and returned to Yathrib and converted most of their tribes (about 70% ) to Islam and this was the time these quarelling two Arab groups of Aus and Khazraj came closer to each other with this great news and jointly invited Prophet P.B.U.H to Medina.
Prophet saws sent his first delegation of his about 7 – 10 companions the good memorizers of Quran to teach them Islam first. This was followed by a pledge at Aqaba by these two groups arriving near Mecca to Protect the Prophet at all cost even sacrificing their most loved ones as per Quran on the blessed hand of Prophet SAWS and other sahabas who were in great trouble under the attrocities of pagans started migrating to Yathrib in tiny groups and disguised but most of their wealth and belongings were confiscated.
As per the order of Allah Prophet Muhammud P.B.U.H awaited the permission of Allah ( unlike Prophet Jonah P.B.U.H who fled before the permission of Allah came and was swallowed by a Whale) to emigrate until the hot day when he visited at noon ( Aysha says she felt wierd that her fathers dearest friend Muhammud never visited their house during hot noon time and that too in disguised form, as noon was their normal resting time ) and gossiped to Abu Bakr RA that the Order of Allah has come to emigrate that night and get ready for the journey. So this was the night that about 10 Meccan pagans from each tribe surrounded Prophets house when he left his cousin Ali RA on his bed with also duty to deliver the valuables under his custody ( no wonder pagans titled Muhammud P.B.U.H Al Ameen -The Trustworthy though they did not like his Islam but loved his custodianship) and threw the sand on the wind that created a small sand storm ( a miracle as in Quran ) and walked away right in front of those a dozen thugs who were with swords to kill this single Trust worthy Messenger of Allah.