The Battle of Nahrawan was fought between the army of Caliph Ali and the rebel group Kharijites in July 658 CE. They were a group of pious allies of Ali during the First Muslim Civil War. They separated from him following the Battle of Siffin when Ali agreed to settle the dispute with Mu'awiya, governor of Syria, through negotiations, a move labeled by the group as against the Qur'an. After failed attempts to regain their loyalty and because of their rebellious and murderous activities, Ali confronted the Kharijites near their headquarters by the Nahrawan Canal, near modern-day Baghdad. Of the 4,000 rebels, some 1,200 were won over with the promise of amnesty while the majority of the remaining 2,800 rebels were killed in the ensuing battle. Other sources put the casualties at 1500–1800. The battle resulted in a permanent split between the group and the rest of the Muslims, whom the Kharijites branded as apostates. Although defeated, they continued to threaten and harass cities and towns for several years. Ali was assassinated by a Kharijite in January 661.