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