 Ali was assassinated by Kharijites in 661.Six months later in 661, in the interest of peace, Ali's son Hasan, made a peace treaty with Muawiyah I.In the Hasan–Muawiya treaty, Hasan ibn Ali handed over power to Muawiya on the condition that he would be just to the people and not establish a dynasty after his death.