Self-Sacrifice and Devotion of Imam Ali ibn Abu Talib (AS)
There is no doubt to it that every body loves his soul and very rarely gets ready to sacrifice it for another person but because of the fact that Imam Ali ibn Abu Talib (AS) loved the soul of the Prophet Mohammad (pbuh) even more than his own one, he got prepared to lay his life for him.
The event takes shape like this. When the polytheists saw that they are in danger, they jointly made a firm determination to take the Prophet Mohammad (pbuh) by surprise and martyr him. So all of them gathered in "Dar un Nadva" and choose one person from each family so that every tribe gets involved in getting Prophet Mohammad (pbuh) killed and then no one could take the revenge of him.
The Prophet Mohammad (pbuh) had come to know about this conspiracy through revelation. God ordered him (pbuh) to migrate from Macca in the darkness of the night. The Prophet Mohammad (pbuh) needed someone, prepared to sacrifice his life and must be a trustworthy secret holder.
Hence, there was no one else except Imam Ali ibn Abu Talib (AS) in whom he confided, and told him "God has informed me that the infidels will break through the house to kill me so today you sleep on my bed."
Imam Ali ibn Abu Talib (AS) smilingly accepted it, because he (as) knew that the life of the Prophet Mohammad (pbuh) would be saved by his action. In fact, Imam Ali ibn Abu Talib (AS) used to say later that the best sleep he had ever had was on that night (Shab-e-Hijrat).
Then the time came when the darkness of the night covered everything and Imam Ali ibn Abu Talib (AS) was sleeping on the prophet’s (pbuh) bed calmly and peacefully and the Prophet Mohammad (pbuh) came out of his house and started proceeding towards the Cave of Saur with Abu Bakr. The infidels besieged the house and got prepared with their swords and spears to attack it. The sooner they were instructed to make it, they break through the house rushing with naked swords. But when they found Imam Ali ibn Abu Talib (AS) laying on the bed of the Prophet Mohammad (pbuh) they immediately moved out of the house desperate and astonished, and sent a few horsemen to search the Prophet Mohammad (pbuh). But not very long afterwards they too returned defeated and hopeless.
Allah liked this action of Imam Ali so much that HE(God) revealed this verse in the Holy Quran: "And among men is he who sells his NAFS (self) in exchange for the pleasure of Allah..." (Surah 2: Baqarah / Verse 207)
Quranic Verses about Imam Ali s Imamate
amir al-muminin's behavior towards guests
Imam Ali ibn Abu Talib (AS) and Holy War
The Only Person Born in Holy Kaba
Who Is Imam Ali (A.S)?