Claiming to represent Ibn al-Hanafiyya, Mukhtar al-Thaqafi rose in Iraq in 686 to avenge Husayn and his relatives, who were massacred in 680 CE by forces of the Umayyad caliph Yazid bin Mu'awiya (r. 680–683).
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 of time and eradicate injustice and evil.
[7][8] When Ali was assassinated in Kufa in January 661,[9][10] his eldest son Hasan was elected caliph there,[11][12] but later abdicated in favor of Mu'awiya I (r. 661–680) in August 661.
[13][14] Hasan died in 669 in Medina, probably poisoned at the instigation of Mu'awiya,[14][13][15] who thus paved the way for the succession of his son Yazid I (r. 680–683)[16][17] often portrayed by Muslim historians as impious and immoral.
[13] When the Umayyad Marwan and the prophet's widow Aisha prevented the burial of Hasan near his grandfather, Ibn Hanafiyya is said to have convinced Husayn to bury their brother in the Baqi Cemetery.
[8] Among many others, Ibn al-Hanafiyya is said to have warned Husayn not to trust the Kufans, who had betrayed their father Ali and their brother Hasan, suggesting that he should instead stay in Mecca or conceal himself in Yemen.
[8] He was killed in the ensuing Battle of Karbala, alongside most of his male relatives and his small retinue, having been surrounded for some days and deprived of the drinking water of the nearby Euphrates River.
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.
[2] After Husayn's death, Mukhtar likely considered Ibn Hanafiyya as the rightful imam,[32] referring to him as Ali's surviving wasi (lit.
[28] 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.
[36] 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.
[26][51] The Kaysanites condemned the caliphs preceding Ali ibn Abi Talib as usurpers of his right to succeed the Islamic prophet Muhammad.
[62] The movement of Mukhtar ultimately paved the way for the overthrow of the Umayyads,[63] as the Kaysanites provided the organizational structure for the successful rebellion of the Abbasids,[64][65] who claimed descent from Muhammad's paternal uncle, Abbas.
[65][66] This was apparently the main Abbasid claim to legitimacy until they declared around 780 that the heir of the Islamic prophet Muhammad was his uncle Abbas rather than his cousin and son-in-law, Ali ibn Abi Talib.