After the death of Imam Ali (A), his son Imam Hassan (A) inherited the caliphate.
After the death of Imam Ali (A), his son Imam Hassan (A) inherited the caliphate. Mu'aawiya did not give him a respite. He commissioned a big army and marched from Syria to Iraq to fight Imam Hassan (A). With deceit and carrot and stick he managed to manipulate the military situation in his favour.
With many of his military commanders defecting to the enemy side, falling prey to Mu'aawiya's promises, Imam Hassan had no alternative but to sign a (truce) with Mu'aawiya, driven by concern to preserve what was left of the disciples (companions) of the Prophet in his camp, who were tracked down by Mu'aawiya's agents. It was for this and the fact that Imam Hassan wanted to buy time to re-organise his depleted army. Imam Hassan was forced to sign the cease-fire agreement with Mu'aawiya.
However, Mu'aawiya did not keep his part of the agreement. He unilaterally revoked the agreement. For him, extending his power base to include Iraq mattered the most. He made this evidently clear in his address to the Kufans: "Oh people! I did not wage war against you in order to make you observe prayer, fast, pilgrimage, and pay religious dues. I only did so to be able to be in charge of your affairs".
As the era of Mu'aawiya was drawing to a close with all the calamities inflicted on the followers of Imam Ali (A), especially the elite amongst them, he appointed his son wayward Yazid as heir-apparent. This move inflamed the feelings of the majority of Muslims. In protest they refused to endorse his appointment due to his public debauchery and the fact that he did not meet the most basic of requirements of the Islamic office of Caliph.
On top of those who publicly rejected Yazid's appointment at the helm of Muslim's affairs were Imam Hassan and his brother, Imam Hussain (A). Thus, Mu'aawiya decided to get rid of them so that he may have a free hand in his plan for the succession to the Ummayyad rule. He was successful in assassinating Imam Hassan (A) through poisoning by his wife Ju'dah bint al-Ash'ath, having promised her marriage from his son Yazid.
After implementing the plan, he did not deliver, accusing her of betrayal and fearing for his own son as she might do the same thing to him. As for Imam Hussain (A), the circumstance were not right for Mu'aawiya to kill him. He left the task of liquidating him to his son, Yazid. When Yazid rose to power after the death of his father, he ordered the governors of provinces to get the pledge of allegiance for him from the Muslims.