The roots of the civil war go back to the First Fitna. After the assassination of the third caliph, Uthman, the Islamic community experienced its first civil war over the question of leadership, with the main contenders being Ali and Mu'awiya. Following the assassination of 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 move 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 assaulted 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 collapsed throughout the caliphate except in certain parts of Syria; most provinces recognized Ibn al-Zubayr as caliph. A series of pro-Alid movements demanding revenge for 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. 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 Abd al-Malik ibn Marwan, the Umayyads reasserted control over the caliphate after defeating the Zubayrids at the Battle of Maskin in Iraq and killing Ibn al-Zubayr in the siege of Mecca in 692.
