Ali ibn Abi Talib, the fourth (last) Sunni Rashidun caliph and first Shia Imam, was assassinated by a Kharijite called Ibn Muljam on 26 January 661 at the Great Mosque of Kufa, in present-day Iraq. Ali, who was then 62 or 63 years of age, died due to his injuries two days after Ibn Muljam struck him on his head by a poison-coated sword, on the 21 (or 19) Ramadan 40 AH (28 January 661 CE). He was the third successive caliph, after Umar and Uthman, to be assassinated.
Ali became the caliph after the assassination of Uthman in 656. However he faced opposition from various factions including the Levant governor, Muawiyah I. A civil war, called the First Fitna, took place within the early Islamic state which resulted in the overthrow of the Rashidun caliphs and the establishment of the Umayyad dynasty. It began when the caliph Uthman ibn Affan was assassinated in 656 and continued through the four-year reign of Ali. After Ali agreed to arbitration with Muawiyah I following the Battle of Siffin (657), a revolt happened against him by some members of his army, later known as Kharijites ("those who leave"). They killed some of Ali's supporters, but they were crushed by Ali's forces at the Battle of Nahrawan in July 658.
Ibn Muljam met up with two other Kharijites namely al-Burak ibn Abd Allah and Amr ibn Bakr al-Tamimi at Mecca, and concluded that the situation of the Muslims at the time was due to the errors of Ali, Muawiah and Amr ibn As, governor of Egypt. They decided to kill the three in order to resolve the "deplorable situation" of their time and also avenge their companions killed at Nahrawan. Aiming to kill Ali, Ibn Muljam headed toward Kufa where he fell in love with a woman whose brother and father had died at Nahrawan. She agreed to marry him if only he could kill Ali. Consequently, Ali was stabbed by Ibn Muljam at the Great Mosque of Kufa. After Ali's death, Ibn Muljam was executed in retaliation by Hasan ibn Ali.
Events leading to Ali's assassination trace back to the death of Muhammad, prophet of Islam, where the community of Muslims disputed over his succession as the leader of Ummah. The assembly at the Saqifat Bani Saida gave allegiance to Abu Bakr as the caliph. While Sunni muslims believed that Muhammad had not selected a successor, Shia Muslims believed that Ali was appointed as Mohmmad's successor by God referring to the event of Ghadir Khumm. Abu Bakr was succeeded by Umar, who was murdered in 644. After Umar's death, Ali, the cousin and son-in-law of Muhammed, and Uthman were contenders for the post. Uthman was elected as caliph by an election council . Ali became the caliph after the assassination of Uthman in 656.
Ali's caliphate was coincident with First Fitna. Though Ali was elected as the fourth Rashidun (the "rightly guided") caliph five days after Uthman's death, he faced opposition during his rule. On one hand, A'isha, Talhah and Al-Zubayr revolted against him in Mecca and on the other hand Muawiyah I, the Umayyad governor of Levant, refused to pledge allegiance to him as the new caliph. Therefor, civil war took place which was about succession to the office of caliphate. Ali's opponents asked the killers of Uthman should be punished. Ali, first emerged victorious at the Battle of Camel in 656, against an army primarily led by Muhammad's wife Aisha and other sahaba. Then, Ali also fought the Battle of Siffin in 657 against Muawiyah. The battle ended in a stalemate with Ali entering into arbitration with Muawiyah.
A group of Ali's army, later known as Kharijites or Khawarij ("those who leave"), opposed against arbitration after the battle of Siffin, when he accepted arbitration with Mu'awiya. They opposed to human judgement in the matter of religion and used "Judgment belongs to God alone," as their slogan. In 658 they violated their oath of allegiance, revolted and openly threatened to kill any Muslim who would not join them. Ali defeated them at the Battle of Nahrawan. The killing of the Kharijites was "the most problematic event" during Ali's caliphate, because they had been among his most vigorous allies in the war against Muawiah.
Ibn Muljam along with two other men, namely al-Burak ibn Abd Allah and Amr ibn Bakr al-Tamimi, all considered as belonging to Kinda, met at Mecca and had a long discussion after the pilgrimage ceremony. They concluded that the situation of Muslims at the time was due to Ali, Muʿawiya and Amr ibn al-As, "whom they regarded as being in error", and swore to kill them to also "avenge their companion's massacred at al-Nahrawan." They arranged the date of assassination and each of them chose his victim.
Ali was assassinated by Ibn Muljam, a Kharijite from Egypt, at the Great Mosque of Kufa, located in Kufa, Iraq, on 26 January 661. Ibn Muljam was of Himyar paternally but was counted among the Murad due to his maternal kinship, and allied with the Banii Jabala of Kindah. He had entered Kufa with the aim of killing Ali to avenge the Kharijite leaders at al-Nahrawan.
In Kufa, he encountered a group of people from Taym al-Ribab tribe who were mourning ten of their tribemates killed at Nahrawan by Ali's army. Among them was a woman named Quttaam. According to cleric Ali al-Sallabi, on seeing Quttaam, he "lost his senses" and "forgot the assignment" for which he was roaming, and proposed to her. Quttaam said that she would marry him if he could "heal" her by giving her three thousand dinars, a chanteuse, a male slave and the death of Ali. Quttaam wanted revenge too as her father and brother had been killed by Ali's forces at Al-Nahrawan. Ibn Muljam persuaded a man called Shubayb to assist him in killing Ali. Besides Shablb ibn Bujra, Wardan ibn al-Mujalid also were Ibn Muljam's accomplice. The conspirators stationed themselves opposite the door from which Ali would enter the Mosque.
On Friday, 19 (or 17) Ramadan, Ali entered Kufa mosque to perform the morning prayer. Ibn Muljam wounded Ali on the "crown of his head" by a poisoned sword after Ali had recited verses from the Sura al-Anbiya as part of the worship, or when he was entering the mosque. Shablb's sword did not hit Ali and instead "hit the wooden frame of the door or the arch." He fled and was caught near the gates of Kinda by 'Uwaymir', but could finally escape through the crowd. Wardan ran away to his home and was killed there by a relative, "'Abd Allah b. Najaba b. Ubayd, after confessing his involvement." Ibn Muljam was caught by the Hashimite al-Mughlra ibn Nawfal ibn al-Harith.
al-Ash'ath ibn Qays was the chief of Kindah tribe in Kufa. According to Wilferd Madelung, in the final years of Ali's reign he had tendency towards Muawiah and received letter including offers of money from him to show reluctance about Ali's campaign against Muawiah. Some sources have accused al-Ash'ath of being informed of the plot of the assassination of Ali. According to al-Yaqubi, Ibn Muljam was hosted by al-Ash'ath for a month when Ibn Muljam had been preparing his sword. Another report by Ibn Sa'd says that al-Ash'ath stayed the night of the killing at mosque counseling Ibn Muljam and that al-Ash'ath signaled the time of attempting the assassination by saying "the morning has smiled." The majority of the sources narrates an ambiguous phrase from Al-Ash'ath:"the dawn has risen for thee" and those who has Shia tendency give it as a clear encouragement to Ibn Muljam: "Deliverance, deliverance! The dawn has risen for thee." After assassination, Hujr ibn 'Adi accused him for Ali's murder. There is even a report which says he warned Ali about Ibn Muljam. According to Laura Veccia Vaglieri, the sources narrate different reports which vary from outright accusation to a suspicion of complicity and even to an act of loyalty.
However al-Sallabi believes that these accusations against al-Ash'ath seem baseless as he was a loyalist and was against Kharijites from the time they first appeared and fought them at Nahrawan. He was also the first one to fight against the people of Syria in the battle for the water. Moreover, he believes there exists no narration from the family of Ali ibn Abi Talib supporting these accusations against al-Ash'ath, neither his family did not discuss it with any member of al-Ash'ath's family. After Ali was injured by Ibn Muljam, al-Ashʿath sent his son to determine Ali's condition, his words suggesting that he knew Ali would not survive.
Ali ordered that if he died from the wound, Ibn Muljam had to be executed in retaliation. Otherwise, if he survived, he would decide on how to treat him. Ali died two days later on 21 Ramadan 40/30 January 661 (or 19 Ramadan 40/28 January 661) at the age of 62 or 63, and Ibn Muljam was killed in retaliation (Qisas) by Hasan ibn Ali, in accordance to Ali's instruction.
Ali's body was washed by his sons, Hasan, Husayn, Muhammad ibn al-Hanafiyyah and one of his nephew, Abdullah ibn Ja'far. Then secretly buried by those men and 'Ubaydullah ibn al-Abbas, since it was feared that his body would be "exhumed and profaned". Some sources claim Ali was buried at the Imam Ali Mosque at Najaf in present-day Iraq, while others, usually Afghans, say he was buried at the Rawze-e-Sharif in the Afghan city of Mazar-e-Sharif. Ali's death is commemorated by Shia Muslims every year.
Two types of traditions exist regrading Ali's awareness of his fate long before the assassination. This foreknowledge was through his own "premonition of it" or by Muhammad. Based on numerous traditions, Ali's beard staining with "blood flowing from his head" had been revealed by Muhammad or Ali. Another set of traditions by Muhammad says that "the most evil man among the ancients was he who had killed the camel of the prophet Salih and among his contemporaries, he who would kill Ali." The night of the assassination, Ali said that his fate was about to come true, and when he left home in the morning, "geese followed him, cackling" weeping for his funeral, as he said later.
According to Wilferd Madelung, a small minority of people were convinced that "he was the best of Muslims after the Prophet and the only one entitled to rule them," and after Ali's death people were divided regarding their view toward him. "Distrust of, and opposition to, Mu'awiya and his Syrian cohorts" was what united the majority. Ali's admirers then turned into majority due to "highhandedness, misrule and repression" of Umayyad.
After Ali's death, the Shias of Iraq declared Ali's eldest son Hasan the successor to Ali, thus proclaiming him as their new caliph. However, Hasan was not interested in becoming caliph, and to prevent further bloodshed, he signed the Hasan–Muawiya treaty and abdicated in favor of Muawiyah, who became the first caliph of the Umayyad caliphate. Muawiyah died in Medina at the age of forty-five in 669, and was succeeded by Yazid I in 61 AH (680 CE) but Hasan's brother Husayn ibn Ali refused to accept Yazid's leadership. After being invited by the Shiites of Iraq in the same year, Husayn started his march to Iraq. However, during their stay at Karbala, his army was massacred by Yazid at the Battle of Karbala on 10 Muharram (10 October) and his death is commemorated by Shia every year during Muharram.