Topic summary
Muhammad ibn al-Hanafiyya

Muhammad ibn al-Hanafiyya (Arabic: مُحَمَّد ابْن الْحَنَفِيَّة, romanized: Muḥammad ibn al-Ḥanafiyya, c. 637–700, 15–81 AH) was a son of Ali ibn Abi Talib and an effective lieutenant for his father during his caliphate. After the assassination of Ali and the deaths of his two sons Hasan and Husayn, many recognized Ibn al-Hanafiyya as the head of the Alids. Claiming to represent Ibn al-Hanafiyya, Mukhtar al-Thaqafi rose in Iraq in 686 to avenge Husayn and his relatives, who were killed at the Battle of Karbala by the forces of the second Umayyad caliph Yazid I. The quiescent Ibn al-Hanafiyya did not actively associate with this rebellion but was still rescued by Mukhtar when he was detained by the rival caliph Abd Allah ibn al-Zubayr.
Support for Ibn al-Hanafiyya continued even after the death of Mukhtar in 686 in the form of the Kaysanites, a now-extinct Shia sect that traced the Imamate to Ibn al-Hanafiyya and his descendants, particularly his son Abu Hashim. After the death of Ibn al-Hanafiyya in 700–701, some Kaysanites declared that he was the Mahdi, the eschatological Islamic leader who would reappear in the End Times and eradicate injustice and evil alongside Isa (Jesus). The Kaysanites later provided the organizational structure for the Abbasids to overthrow the Umayyads in 750.