Upon the death of Ali in Kufa, a new caliph was chosen. Kufi Muslims pledged allegiance (bay'ah) to his eldest son Hasan without dispute.
Muawiyah summoned all the commanders of his forces in Syria, Palestine and Transjordan to join him in preparation for war. He also attempted to negotiate with Hasan, sending the young heir letters asking him to give up his claim. If he could persuade Hasan to renounce his claim to the caliphate, then Muawiyah would certainly avoid the undesirable consequence of killing fellow Muslims and would further support his claim to the caliphate. If Muawiyah was forced to defeat Hasan in battle, Muawiyah would gain absolute power, but questions regarding his legitimacy would linger.
The two armies fought a few inconclusive skirmishes. Hasan, distressed that the result of a battle would mean a loss of many men and a lack of people to go back and partake in caring for the people. Muawiyah also had his concerns with forcing a battle and because of that he sent two men from Banu Quraish to Hasan ibn Ali in order to negotiate a settlement with Hasan ibn Ali and his followers. Hasan ibn Ali, foreseeing the events that were to transpire and to avoid unnecessary bloodshed, finally negotiated a settlement with Muawiyah. With regards to the negotiation, the Prophet had prophesied earlier, saying, "It is this grandson of mine, on whose hands the two great armies from amongst the Muslims will stop fighting." (Bukhari)
According to Sunni scholarship, Hasan stipulated Muawiyah should follow the Qur'an and the Sunnah, allowing a shura for the caliphate to be held after his death and refrain from any acts of revenge against Hasan ibn Ali's followers.
Many authors have also mentioned that Muawiyah accepted all the conditions attached to the peace treaty . Muawiyah proceeded to Kufa and demanded the Muslims there swear allegiance. He also asked Hasan to join him and support him in the fight against the rebellious Kharijites.
Hasan is claimed to have written him in response: "I have abandoned the fight against you, even though it was my legal right, for the sake of peace and reconciliation of the nation. Do you think that I shall then fight together with you?"