Imam al-Shafi'i (may Allah have mercy on him) said: "Imam Abu Yusuf (may Allah have mercy on him) narrated from a man, from Abu Ja'far, that Sayyiduna al-Hasan bin Ali (may Allah be pleased with them both) killed Ibn Muljam in retaliation for Sayyiduna Ali (may Allah be pleased with him)."
Imam Abu Yusuf (may Allah have mercy on him) said: "And Sayyiduna Ali (may Allah be pleased with him) also had some young (minor) children."
Some of our companions said: "Sayyiduna al-Hasan bin Ali (may Allah be pleased with them both) decided on his own to kill him before the young children of Sayyiduna Ali (may Allah be pleased with him) reached maturity only because he killed him as a hadd punishment for his disbelief, not as retaliation."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنايات / Q16069
Abu Sinan al-Du'ali (may Allah have mercy on him) said that he visited Sayyiduna Ali (may Allah be pleased with him) during an illness of his and said: O Commander of the Believers! We fear for you in this ailment of yours (lest you be martyred in it). Sayyiduna Ali (may Allah be pleased with him) said: "By Allah! I have no fear for myself, because I have heard the Messenger of Allah (peace and blessings be upon him) say: 'Soon you will be struck here and here' — he (peace and blessings be upon him) was pointing to his temples — 'and your beard will be soaked with blood, and the one who does it will be the most wretched of people, just as the one who hamstrung the she-camel was the most wretched person among the people of Thamud.'"
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنايات / 16069