At the age of twelve, Imam Ali (AS) was the only one who stood up and declared his allegiance and full support for the Prophet Muhammad's (SAW) mission. In return, the Prophet blessed Imam Ali (AS) and said, "From now on you are my helper, my Wazeer and the Khaliph after me on Earth." History bears witness that all his life Imam Ali (AS) fulfilled this pledge and supported the Prophet of Islam in his mission.
On the famous night of the migration of the Prophet (SAW) from Mecca to Medina, when 40 swordsmen were preparing to murder the Holy Prophet (SAW), Imam Ali (AS) occupied the Prophet's bed while the Prophet, on instructions from Allah (SWT), escaped their evil intentions in the darkness of the night.
In Medina Imam was always with the Prophet and his presence was felt at every battle that was fought to defend Islam: Badr, Ohad, Khandaq, Khayber, Honain were all fought and won under the command of Imam Ali (AS).
He regarded it his duty as the Holy Imam to give advice on religion, to whoever asked him. The famous historial Yaqubi puts Imam Ali's name on the top of the list of jurists at the time of the first three Caliph's. After the death of the third Caliph, Hazrat Uthman (RA) in 36 A.H, people of Medina bespeeched him to accept the mantle of Caliphat, which he reluctantly accepted saying that:
Had they not swom unconditional allegiance to me, had they not sworn their gratefulness in my accepting their rulership and had Allah (SWT) the Almighty not taken a promise from the guides of religion to put a check on the luxurious and vicious lives of the oppressors and tyrants, as well as to reduce poverty and starvation of the oppressed, I would even now have left the rulership of the State and would have allowed it to sink into anarchy and chaos as i did in the early days. The pomp and glory of a vicious life is to me worth less than the sneeze of a goat."