After the death of Husayn, his only surviving son,
Ali ibn Husayn Zayn al-Abidin, retired to an apolitical life in Medina. Ibn al-Hanafiyya was thus considered by many as the head of the
House of Ali. Indeed,
Mukhtar al-Thaqafi soon claimed to represent Ibn Hanafiyya in Kufa, calling for revenge for the Karbala massacre. His efforts were bolstered by the defeat of the alternative
Tawwabun rebellion in 684. Mukhtar eventually seized control of Kufa in 686 from
Abd Allah ibn Zubayr, who had established in 680 an alternative caliphate in Mecca that rivaled the Umayyads. It is doubtful that Mukhtar actually represented the quiescent Ibn Hanafiyya. Nevertheless, the noncommittal response of Ibn Hanafiyya was interpreted by a Kufan delegation as an implicit endorsement of Mukhtar, which in turn strengthened the Kufans' support for the latter.
Mahdi After Husayn's death, Mukhtar likely considered Ibn Hanafiyya as the rightful imam, referring to him as Ali's surviving () after Hasan and Husayn. Mukhtar also referred to Ibn Hanafiyya as the
Mahdi (), that is, the leader who would deliver Muslims from oppression and spread justice. At this point, however, this title of Ibn Hanafiyya probably did not have any messianic implications. At any rate, Ibn Hanafiyya is said to have avoided this title, as he remained in his hometown of Medina and declined active leadership of the revolution. Perhaps an indication of his equivocal attitude towards the rebellion, Ibn Hanafiyya is said to have been represented in some later
Hajj pilgrimages by his personal flag as the head of the House of Ali.
Avenging Husayn True to his promise, Mukhtar killed several figures thought to be responsible for the Karbala massacre, including the Kufa governor Ibn Ziyad and the Umayyad commander
Umar ibn Sa'd (), whose head was then sent to Ibn al-Hanafiyya by some accounts. Also killed was
Shamir ibn Dhi al-Jawshan, often viewed as responsible for beheading Husayn in Karbala. Elsewhere, Murra ibn Munqidh al-Abdi survived a revenge attempt but was severely wounded. He is said to have killed Husayn's son
Ali al-Akbar. Yet
Asma ibn Kharija al-Fazari and
Muhammad ibn al-Ash'ath al-Kindi escaped Mukhtar unharmed. The former was sought for his role in killing Muslim ibn Aqil and the latter was accused of insulting Husayn in Karbala.
Confrontation with Ibn al-Zubayr Saying that he was waiting for communal consensus, Ibn Hanafiyya had refused to pledge his allegiance to Ibn al-Zubayr, the self-proclaimed caliph in Mecca. Some have therefore suggested that Ibn al-Hanafiyya might have had his own ambitions for the high office. Perhaps it was this refusal to take the oath of allegiance and the takeover of Kufa by Mukhtar that provoked the Meccan caliph to imprison Ibn Hanafiyya. He now wrote to Mukhtar for help and was rescued by his military detachment(s). The rescue mission is said to have been bloodless, as Ibn Hanafiyya had forbidden Mukhtar's men from fighting in the sanctuary of Mecca. This appeal for help suggests that the passive attitude of Ibn Hanafiyya towards Mukhtar has been exaggerated. Ibn Hanafiyya then settled in
Mina, near Mecca, and later in
Ta'if.
Death of Mukhtar Mukhtar was defeated and killed in 686687, yet Ibn Hanafiyya was not compromised afterward, which perhaps indicates his weak ties with Mukhtar. Ibn Hanafiyya continued to withhold his support from the two rival caliphates until the fall of Zubayr in 692, at which point he pledged his allegiance to the Umayyad caliph
Abd al-Malik (). By some accounts, he visited the caliph in Damascus in 692, who generously compensated him. == Kaysanites ==