Conspiracy of murdering the Holy Prophet
After the settlement in Yathrib of Meccan Muslims, the chiefs of Quraysh realized that Yathrib had turned into a strong shelter for the Holy Prophet and his followers, and that people of Yathrib were ready to fight for their faith. For this reason, they feared the Holy Prophet's emigration. This matter caused the Quraysh to face several problems:
(1) Muslims were no longer under their domination and control, because Yathrib was an independent city and Quraysh had no power there.
(2) Since people of Yathrib had convened a war treaty with the Holy Prophet, he might then start a siege on Mecca for revenge.
(3) Even without a probable war, Quraysh were still at a loss, because Yathrib was a lucrative market for their merchants and they would face economic disasters through losing control over this city.
(4) Yathrib was on the trade route from Mecca to Damascus and Muslims could easily make this route unsafe and vulnerable; they might also jeopardize trade as a whole.
These worries forced the chiefs of Quraysh to gather at D¡r al-Nidwah (the consular center) for further consultation and deliberations. Some proposed that the Holy Prophet be exiled or imprisoned. However, these two proposals were rejected for certain reasons. Finally, they decided to murder him although such an act would not look very simple, because Ban£-H¡shim would seek revenge. To avoid such expected vengeance, they decided to appoint one young man from every tribe so that they could murder him in his bed. In this way, Ban£-H¡shim could not rise to avenge because the assassination would have taken place with several men from different tribes; and Ban£-H¡shim could not fight all these tribes; so, they would have to receive ransom and blood-money and the story would come to an end. To carry out their plot, chiefs of Quraysh selected the first night of Rab¢` al-Awwal. God refers to their conspiracy with the following words:
And when those who disbelieved devised plans against you that they might confine you, slay you, or drive you away; and they devised plans and Allah too had arranged a plan; and Allah is the best of planners. (8:30)
The Prophet's Migration
Through Divine revelation, the Holy Prophet knew about the conspiracy of D¡r al-Nidwah; he was then ordered by God to leave Mecca. He informed Imam `Al¢ (a.s) about his plan and ordered him to replace him in bed that night and cover himself with his bedspread. Imam `Al¢ (a.s) immediately accepted this mission.
Accompanied by Ab£- Bakr, the Holy Prophet headed for Thawr Cave to the south of Mecca that night and stayed there for three days until chiefs of Quraysh despaired of finding him. He wanted to find a safe time to continue his migration. God, in the Holy Qur'¡n, refers to the Holy Prophet's loneliness and to the worries of his companion. Despite all precautious actions that the chiefs of Quraysh had taken, they could not locate the Holy Prophet:
If you will not aid him, Allah certainly being the second of the two, when they were both in the cave, when he said to his companion: Grieve not, surely Allah is with us, So Allah sent down His tranquility upon him and strengthened him with hosts which you did not see, and made lowest the word of those who disbelieved; and the word of Allah that is the highest; and Allah is Mighty, Wise. (9:40)
A Great Sacrifice
That night, Imam `Al¢ (a.s) replaced the Holy Prophet in bed. The armed forces of Quraysh besieged the Holy Prophet's house. In the morning, they drew their swords and entered the house in a rampage, but they found Imam `Al¢, not the Holy Prophet, in the bed. Realizing that they had been betrayed, they charged against `Al¢. Drawing his sword, he stood opposite against and refused to tell them where the Holy Prophet was.
Anybody who would replace the Holy Prophet in bed had little chance to survive. However, `Al¢, who had replaced the Holy Prophet in bed many times before that event, such as he had done when they were besieged in Ab£-±¡lib Col, in purpose of securing his safety, sacrificed his life to protect the Holy Prophet's. Referring to this bravery and sacrifice of Imam `Al¢, Almighty God says:
And among men is he who sells himself to seek the pleasure of Allah; and Allah is Affectionate to the servants. (2:207)
Exegetes of the Holy Qur'¡n agree that this verse was revealed on account of the sacrifice and bravery of `Al¢ at that night, which is called laylat al-mab¢t.
Referring to the conspiracy of Quraysh during that dangerous night, Imam `Al¢, in one of his sermons, describes his mental condition as follows:
The Prophet ordered me to spend that night on his bed (while he would be leaving for Medina) and use my life as a shield for the protection of his life. I accepted it on the spot. I would be glad to die for him. The Prophet left me and I slept on his bed. The Quraysh armed forces entered, hoping to murder him. When they charged at the room where I was staying, I stood up, drew my sword and protected myself. This is the issue of which God is aware and people know.”
The Prophet's Arrival at Qub¡
Prior to his departure from Mecca, the Holy Prophet asked Imam `Al¢ to give back people's deposits and prepare for the departure of his daughter, F¡§imah, and some other men and women from Ban£-H¡shim, who had not yet departed Mecca.
On the fourth of Rab¢` al-Awwal (the 14th year after prophethood), the Holy Prophet left Thawr Cave for Yathrib. Eight days after that, he arrived at the district of Qub¡, on the outskirts of Yathrib, where the tribe Ban£-`Amr ibn `Awf lived. He waited there for a few days, waiting for `Al¢'s arrival. During this time, he established a mosque there.
After the Holy Prophet's migration, `Al¢ (a.s) stayed for three days in Mecca and carried out his obligations and tasks. He then accompanied his mother F¡§imah bint Asad and F¡§imah daughter of the Holy Prophet and F¡§imah daughter of al-Zubayr ibn `Abd al-Mu§§alib and two others to Qub¡ where they joined the Holy Prophet
 op cit.
 The event of D¡r al-Nidwah (House of Consultation) and Laylat al-Mab¢t (the Night of Staying) have been recorded in the following reference books, yet with little difference: T¡r¢kh al-±abar¢ 2:242-245; al-S¢rah al-Nabawiyyah 2:124-128; Al-±abaq¡t al-Kubr¡ 1:227-228; Dal¡'il al-Nubuwwah 2:147; Ans¡b al-Ashr¡f 1:259- 260; al-K¡mil f¢’l-T¡r¢kh 2:101-103; T¡r¢kh al-Ya`q£b¢ 2:32; I`l¡m al-War¡, pp. 61; Shaykh al-±£s¢’s al-Am¡l¢, pp. 245- 247 and 463- 471; Ibn Shahr¡sh£b’s Man¡qib 1:182- 183; al-Khaw¡rzmi’s Man¡qib, p73; al-Kar¡jak¢’s Kanz al-Faw¡'id 2:55; Ibn Kath¢r’s al-Bid¡yah wa’l-Nih¡yah 3:175-180; Ibn Hush¡m’s al-S¢rah al-Nabawiyyah 2:189-206; al-Kha§¢b al-Baghd¡d¢’s T¡r¢kh Baghd¡d 13:191-192; Bi¦¡r al-Anw¡r 19:47- 65.
 Al-Fatt¡l al-Nays¡b£r¢, Raw¤at al-W¡`i¨¢n, pp. 117; Ibn al-Ath¢r, Usd al-Gh¡bah 4:25; Shablanj¢, N£r al-Ab¥¡r, pp. 86; ±abars¢, Majma` al-Bay¡n 1:301; Ibn Ab¢’l-°ad¢d, Shar¦ Nahj al-Bal¡ghah 13:262; Sib§ ibn al-Jawz¢, Tadhkirat al-Khaw¡¥¥, pp. 35; Ab£-Bakr °amaw¢, Thamarat al-Awr¡q, pp. 20; `All¡mah Am¢n¢, al-Ghad¢r 2:48. `All¡mah Am¢n¢ has reported this event from different reference books, such as, al-Mu¨affar’s Dal¡'il al-¯idq 2:80. Al-Mu¨affar, al-Tha`lab¢, al-Qanad£z¢, al-°¡kim al-Nays¡b£r¢, A¦mad ibn °anbal, Ab£’l-Sa`¡d¡t, al-Ghazz¡l¢, al-Fakhr al-R¡z¢, and al-Dhahb¢—all these Sunni master scholars report that this verse was revealed about Imam `Al¢’s self-sacrifice at that night.
 ¯ad£q, al-Khi¥¡l 2:367; Muf¢d, al-Ikhti¥¡¥, pp. 165.
 Ibn Hush¡m, al-S¢rah al-Nabawiyyah 2:129; ±abar¢, op cit, 2:247; al-Bul¡dhar¢, Ans¡b al-Ashr¡f 1:261; Ibn Shahr¡sh£b, al-Man¡qib 1:183.
 Shaykh al-±£s¢, al-Am¡l¢, pp. 468; Muf¢d, al-Ikhti¥¡¥, pp. 147; al-Suy£§¢, T¡r¢kh al-Khulaf¡', pp. 166.
 Mu¦ammad Ibn Sa`d, Al-±abaq¡t al-Kubr¡ 1:292; al-Majlis¢, Bi¦¡r al-Anw¡r 19:87.
 Ibn Hush¡m, op cit, pp. 137; ±abar¢, op cit, pp. 248; ±abars¢, I`l¡m al-War¡, pp. 64; al-Bul¡dhar¢, op cit, pp. 263; al-Bayhaq¢, Dal¡'il al-Nubuwwah 2:172
 Ibn Shahr¡sh£b, op cit, op cit, 1:185; al-Bayhaq¢, op cit, pp. 166, 172; ±abar¢, op cit, 2:249.
 Ibn Hush¡m, op cit, pp. 138; ±abar¢, op cit, pp. 249.