The community that Muhammad left was united in a way it never was again. Within twenty-five years the third caliph, Uthman, had been killed by rebels in his own house at Medina over grievances about governance and the distribution of offices among his kin. Ali was acclaimed caliph in the aftermath, and the question of whether he should first punish the killers, and whether he could, produced the first civil war among Muslims.
It ran through three phases. At the Battle of the Camel near Basra in 656, Ali defeated a force gathered by Aisha, the Prophet's widow, with Talha and Zubayr, both senior companions. At Siffin the following year he faced Muawiya, the governor of Syria and a kinsman of Uthman, in an inconclusive confrontation ended by an agreement to arbitrate. That agreement split Ali's own army: a party held that judgment belongs to God alone and that submitting the caliphate to human arbitration was itself apostasy, and they left him. These were the Kharijites, whom Ali defeated at Nahrawan and one of whom killed him in 661.
Muawiya took the caliphate and moved the capital to Damascus. Three parties emerge from these five years: those who held the succession belonged to Ali and his house, those who accepted the community's settlement, and those who judged rulers by conduct and were prepared to unchurch them.