Caliph "deputy" was the title of the spiritual and temporal leader of Islam after Prophet Muhammad's death in AD 632. The first four "rightly guided" Caliphs were based in Medina and were Abu Bakr, Umar, Uthman and Ali. Ali was the cousin of Muhammad and his son-in-law, married to Fatimah. Muawiya, the governor of Syria during Ali's caliphate, did not recognize Ali as caliph and rebelled. After the murder of Ali, Muawiya proclaimed himself caliph in Damascus and founded thereby the Umayyad dynasty. His caliphate was not accepted by Ali's followers, the so-called Shiat Ali, "Ali's party", who instead supported Ali's sons Hasan and Husayn and continued to fight against Muawiya. When Ali was murdered the Muslims of Medina transferred the caliphate to Hasan, who resigned the title in favor of Muawiya, in the context of a peace treaty that aimed to save Muslim lives and prevent a continued civil war. Among the conditions was that Muawiya would return the caliphate to Hasan, or his brother, when he died. THIS WAS THE END OF THE FIRST FITNAH (temptation, trial, civil strife)
THE SECOND FITNAH. Hasan dies in AD 670 (probably poisoned) and when Muawiya died in AD 680 his son Yzid was proclaimed caliph in Damascus. Husayn refused to give his oath of allegiance to Yzid and revolted. Huseyn was killed along with his little group of rebels at Kerbala.
The split was now definite between Sunnis (Sunnah meaning "habit", "usual practice", "custom", "tradition”) and Shia.