Hasan ibn Ali (Arabic: الحسن ابن علي, romanized: al-Ḥasan ibn ʿAlī; c. 625 – 2 April 670) was an Alid political and religious leader. The eldest son of Ali and Fatima and a grandson of the Islamic prophet Muhammad, Hasan briefly ruled as caliph from January 661 until August 661. He is considered as the second Imam in Shia Islam, succeeding Ali and preceding his brother Husayn. As a grandson of the prophet, he is part of the ahl al-bayt and the ahl al-kisa, and also participated in the event of the mubahala.
During the caliphate of Ali (r. 656–661), Hasan accompanied him in the military campaigns of the First Fitna. Following Ali's assassination in January 661, Hasan was acknowledged caliph in Kufa. His sovereignty was not recognized by Mu'awiya ibn Abi Sufyan (r. 661–680), the governor of Syria, who led an army into Kufa while pressing Hasan for abdication in letters. In response, Hasan sent a vanguard under Ubayd Allah ibn al-Abbas to block Mu'awiya's advance until he arrived with the main army. Meanwhile, Hasan was severely wounded in an abortive assassination attempt by the Kharijites, a faction opposed to both Ali and Mu'awiya. This attack demoralised Hasan's army and led to widespread desertion. Ubayd Allah and most of his troops also defected after Mu'awiya bribed him. In August 661, Hasan signed a peace treaty with Mu'awiya on the condition that the latter should rule in compliance with the Quran and the Sunnah, a council should appoint his successor, and Hasan's supporters would receive amnesty. Hasan retired from politics and abdicated in Medina where he died either from illness or poisoning, though the early sources are nearly unanimous that he was poisoned. Mu'awiya is commonly viewed as the instigator in the murder of Hasan, which removed an obstacle to the succession of his son Yazid I (r. 680–683).