Muhammad ibn al-Hanafiya

Muhammad ibn al-Hanafiyyah
Religion Islam
Lineage Alid, Hashemite
Sect Shi'ite
Born 633?
Medina, Arabia
Died 700
Medina, Arabia
Resting place Medina, Arabia
Senior posting
Title imam
Period in office 681–?
Predecessor Husayn ibn Ali
Successor Abu Hashim

Muhammad ibn al-Hanafiyyah (15 AH – 80 or 81 AH; c. 633 – 700 CE) surnamed Abu'l-Qasim was an early Muslim leader. He was a son of Ali ibn Abi Talib, the first Shi'ite Imam and the fourth Sunni Caliph.


Muhammad ibn al-Hanafiyyah was born in Medina about 633 CE (though also said to be during Umar's era), the third of Ali's sons. He was called Ibn al-Hanafiyyah after his mother, Khawlah bint Ja'far; she was known as Hanafiyyah, "the Hanafi woman", after her tribe Banu Hanifah. After the death of Muhammad, the people of Yamamah were declared apostates by the Muslims for refusing to pay the zakat (religious tax); the men were killed (see Ridda wars), and the women were taken to Medina as slaves, Khawlah bint Ja'far among them. When her tribesmen found out, they approached Ali ibn Abi Talib and asked him to save her from slavery and to protect her family’s honor and prestige. Consequently, Ali ibn Abi Talib purchased her, set her free, and, after the death of Fatimah, married her.[1] Muhammad ibn al-Hanafiyyah was the only child of Khawlah bint Ja'far. During his father's lifetime he distinguished himself for piety, rectitude, and courage and effectiveness in war. During Ali's caliphate at Kufa he was one of the caliph's four chief lieutenants. He particularly distinguished himself at the battles of Jamal and Siffin.[2]

When Imam Husayn, then in Mecca, was considering the expedition to Kufa that ended at Karbala, Muhammad ibn al-Hanafiyyah advised him not to go,[3] pointing out that the men of Kufa had betrayed and turned against their father Ali[4] and their brother Hasan ibn Ali,[5] and saying that he feared that they would betray Husayn as well. Husayn replied that he feared that if he stayed in Mecca, Yazid ibn Muawiya would have him killed there, and violate the sanctity of the Holy City. Muhammad ibn al-Hanifiyyah then urged him to go instead to Yemen, where he could indefinitely elude an army. The next day Husayn replied that his grandfather Muhammad had appeared to him in a dream and required him to undertake this sacrificial expedition.[6]

After Husayn and so many of his kinsmen died at Karbala and the young Ali ibn Husayn adopted a life of retirement and prayer, Muhammad ibn al-Hanafiyyah became the visible head of the house of Ali (see Kaysanites Shia). It was in his name that Al-Mukhtar rebelled in Kufa in 686 CE. In the hajj of 688 CE, four men led their respective followers in the rites of pilgrimage, claiming the headship of Islam. One was Muhammad ibn al-Hanafiyyah, leading the Shi'ites. The others were Abdullah ibn Zubayr, who ruled in Mecca; Abd al-Malik, the Umayyad, who ruled in Damascus; and Najdah ibn 'Amir, leader of the Kharijites.[7]

Ibn al-Hanafiyyah was called "the Mahdi," "the rightly-guided," which then was simply a pledge of confidence in his knowledge, character, and judgment over those of the rival caliphs. In 692 CE he traveled to Damascus and swore allegiance to Abd al-Malik. In 700 he died in Medina, but thereafter a legend grew up that he was not dead, but living in seclusion on Mount Radwa near Medina, protected and fed by wild animals, and that he would, in God's good time, return to establish justice and true religion in the world. Thus arose the legend of the Mahdi as savior.[8] This is not to be confused with the Twelver Shia Mahdi, who is the son of the 11th Imam Hasan al-Askari.

Succession and legacy

After Muhammad ibn al-Hanafiyya died, his son Abu Hashim claimed the imamate. After his death the Abbasids claimed that on his deathbed Abu Hashim nominated his distant cousin Muhammad ibn Ali ibn Abdullah ibn Abbas ibn Abdu'l-Muttalib ibn Hashim as the imam. This man's son Abu'l-Abbas Abdullah as-Saffah became the first Abbasid caliph, repudiating Shi'ism, which effectively extinguished the sect that had recognized Muhammad ibn al-Hanafiyyah as an imam.[9]

Time line

Muhammad ibn al-Hanafiyyah
of the Ahl al-Bayt
Clan of the Banu Quraish
Born: 633 CE Died: 700 CE
Shia Islam titles
Preceded by
Hussein ibn Ali
4th Imam of Shia Islam
Succeeded by
Abu Hashim


This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.