The Second Fitna was the second civil war in the Islamic community during the early Umayyad Caliphate. It followed the death of the first Umayyad caliph Mu'awiya I in 680, and lasted for about twelve years. The war involved the defeat of three main challenges to the authority of the Umayyad dynasty, the first by Husayn ibn Ali, as well as his supporters including Sulayman ibn Surad and Mukhtar al-Thaqafi who rallied to avenge his death in Iraq, the second by Abd Allah ibn al-Zubayr who proclaimed himself caliph in Mecca and Medina and would be nominally recognized throughout most of the Caliphate, and the Kharijites who took over central Arabia and southern Iraq and Persia.
The roots of the civil war go back to the First Fitna. After the assassination of the third Rashidun caliph Uthman, the Islamic community experienced its first civil war over the immediate question of retribution for his murder. Following the assassination of the fourth Rashidun caliph Ali in 661 and the abdication of his successor Hasan the same year, Mu'awiya became the sole ruler of the caliphate. Mu'awiya's unprecedented decision to nominate his son Yazid as his heir sparked opposition, and tensions soared after Mu'awiya's death. Husayn ibn Ali was invited by the pro-Alids of Kufa to overthrow the Umayyads but was killed with his small company en route to Kufa at the Battle of Karbala in October 680. Yazid's army suppressed anti-government rebels in Medina in August 683 and subsequently besieged Mecca, where Ibn al-Zubayr had established himself in opposition to Yazid. After Yazid died in November the siege was abandoned, and Umayyad authority would soon collapse throughout the caliphate following the death of his son except in parts of Syria where Marwan I was proclaimed caliph; most provinces recognized Ibn al-Zubayr as caliph. A series of pro-Alid movements demanding to avenge Husayn's death emerged in Kufa, beginning with Ibn Surad's Penitents movement, which was crushed by the Umayyads at the Battle of Ayn al-Warda in January 685. Kufa was then taken over by Mukhtar, who rallied Husayn's supporters and the disenfranchised mawali to his cause. Though his forces routed a large Umayyad army at the Battle of Khazir in August 686, Mukhtar and his supporters were slain by the Zubayrids in April 687 following a series of battles. Under the leadership of Marwan, the Umayyads would consolidate their power over Syria and retake Egypt from the Zubayrids, and under his successor Abd al-Malik ibn Marwan, the Umayyads would reconquer Iraq after defeating the Zubayrids at the Battle of Maskin in 691 and would reassert their control over the Caliphate after killing Ibn al-Zubayr in the second siege of Mecca in 692, while their general Al-Hajjaj ibn Yusuf would suppress the Kharijites in the years afterwards.