He is the son of Imam ‘Ali (may Allah ennoble his face). He was called Mohammed and attributed to his mother to distinguish him from his brothers al-Hasan and al-Husayn, the sons of Fatima al-Zahra’ (may Allah be pleased with them all). Consequently, he was called Mohammed ibn al-Hanafiyya in attribution to the clan of Banu Hanifa to which his mother belonged. His mother is Khawla, the daughter of Ja’far and she was known as Khawla al-Hanafiyya.
To give him his due reverence and present him as a role model, it is important at this point to mention a letter which Mohammed ibn al-Hanafiyya wrote to his brother, manifesting his refined affection and altruism. It was said that after a dispute rose between Mohammed ibn al-Hanafiyya and his brother al-Husayn ibn ‘Ali (may Allah be pleased with him), they separated politely and with humility though still in a state of disagreement. When Mohammed ibn ‘Ali reached his house, he thought the matter over and concluded that difference of opinion need not spoil friendship. So he picked up his pen and wrote the following:
In the name of Allah the Most Gracious, the Most Merciful
From Mohammed ibn ‘Ali to his brother al-Husayn ibn ‘Ali.
You have an honor I cannot boast and a virtue I cannot attain. My mother is from Banu Hanifa and your mother is the daughter of the Messenger of Allahﷺ. If the world were filled with women like my mother, they would not measure up to yours.
When you read this, put on your robe and shoes and come to reconcile with me. Do not let me beat you to this virtue of which you are more deserving.
May the peace and blessing of Allah be upon you.
Upon receiving the letter, Imam al-Husayn put on his robe and shoes and went to his brother and they reached a compromise.
When the Roman king wrote to Abdul Malik ibn Marawan, threatening to send 100,000 infantry soldiers and a navy comprising the same number if he does not pay the taxes levied upon him, Abdul Malik wrote to al-Hajjaj and asked him to write a threatening letter to Mohammed ibn al-Hanafiyya and then inform him of his answer. Mohammed’s answered al-Hajjaj with the following:
He looks to your heart 360 times in 24 hours
Allah the High and Mighty looks at the heart of His servants and I pray that He looks at mine just once to protect you from me.
al-Hajjaj sent Mohammed’s letter to Abdul Malik who wrote the same message to the Roman king. The latter said, “Indeed, you did not write this; these words could only be from one belonging to a house of prophethood.”
Mohammed ibn al-Hanafiyya, may Allah be pleased with him, died in 80 AH.