ʿAlī ibn Abī Ṭālib (Arabic: علي بن أبي طالب; c. 600 – 28 January 661 CE) was a cousin, son-in-law and companion of the Islamic prophet Muhammad. He ruled as the fourth rightly guided caliph from 656 until his assassination in 661. He is one of the central figures in Shia Islam as the first Shia Imam and in Sunni Islam as the fourth of the "rightly guided" (rāshidūn) caliphs (name used for the first four successors to Muhammad ). He was the son of Abu Talib and Fatimah bint Asad, the husband of Fatima, and the father of Hasan, Husayn, Zaynab, and Umm Kulthum.As a child, Muhammad took care of him. After Muhammad's
invitation of his close relatives, Ali became one of the first believers in Islam at the age of about 9 to 11. He then publicly accepted his invitation on Yawm al-Inzar and Muhammad called him his brother, guardian and successor. He helped Muhammad emigrate on the night of Laylat al-Mabit, by sleeping in his place. After migrating to Medina and establishing a brotherhood pact between the Muslims, Muhammad chose him as his brother. In Medina, he was the flag bearer in most of the wars and became famous for his bravery.The issue of his right in the post-Muhammad caliphate caused a major rift between Muslims and divided them into Shia and Sunni groups.
On his return from the Farewell Pilgrimage, at Ghadir Khumm, Muhammad uttered the phrase, "Whoever I am his Mawla, this Ali is his Mawla." But the meaning of Mawla was disputed by Shias and Sunnis. On this basis, the Shias believe in the establishment of the Imamate and caliphate regarding Ali, and the Sunnis interpret the word as friendship and love.
While Ali was preparing Muhammad's body for burial, a group of Muslims met at Saqifah and pledged allegiance to Abu Bakr.
Ali pledged allegiance to Abu Bakr, after six months, but did not take part in the wars and political activity, except for the election of the third caliph Uthman. However, he advised the three caliphs in religious, judicial, and political matters whenever they wanted.After Uthman was killed, Ali was elected as the next Caliph, which coincided with the first civil wars between Muslims. Ali faced two separate opposition forces: a group led by Aisha, Talha, and Zubayr in Mecca, who wanted to convene a council to determine the caliphate; and another group led by Mu'awiya in the Levant, who demanded revenge for Uthman's blood. He defeated the first group in the Battle of the Camel; but in the end, the Battle of Siffin with Mu'awiya was militarily ineffective, and led to an arbitration which ended politically against him. Then, in the year 38 AH (658-659), he fought with the Kharijites - who considered Ali's acceptance of arbitration as heresy, and revolted against him - in Nahrawan and defeated them. Ali was eventually killed in the mosque of Kufa by the sword of one of the Kharijites, Ibn Muljam Moradi, and was buried outside the city of Kufa. Later his shrine and the city of Najaf were built around his tomb.Despite the impact of religious differences on Muslim historiography, sources agree that Ali strictly observed religious duties and avoided worldly possessions. Some writers accused him of a lack of political skill and flexibility. According to Wilferd Madelung, Ali did not want to involve himself in the game of political deception which deprived him of success in life, but, in the eyes of his admirers, he became an example of the piety of the primary un-corrupted Islam, as well as the chivalry of pre-Islamic Arabia. Several books are dedicated to the hadiths, sermons, and prayers narrated by him, the most famous of which is Nahj al-Balagha.