Imam Ali (‘a) was fatally wounded by the poisoned sword of Abdur Rahman ibn e Muljim (May Allah never forgive him) on the 19th of Ramadan 40 AH, while offering the Fajr prayers in Masjid e Kufa, in the state of prostration. He completed his prayer and went home with the help of those praying with him. Ibn e Muljim was caught escaping, and with his hands tied behind him, he was brought to the mosque.
The anger and fury of the people was at its height. They were waiting for an order from their Imam (‘a), but their faces showed that they wanted to tear Ibn e Muljim alive. They would have done it, had the Imam (‘a), who was the victim of his dastardly act, allowed them.
Imam Ali (‘a) called for the murderer to be presented before him. He, then, asked him, ‘Was I not gracious towards you?’ ‘You certainly were.’ ‘Then what was the reason for this murderous attack?’ ‘I cannot reveal. However, I placed this sword in poisoned water for 40 days, and prayed to God to make this sword kill the worst man on earth.’
‘So it shall, for you will be killed by this same sword in a few days.’ Imam Ali (‘a) then addressed the members of his family gathered around him, thus: ‘Sons of Abdul Muttalib! I warn you not to let your anger get the better of you. Do not accuse anyone you think is involved in this conspiracy, without evidence, as that will lead to mob killing in the streets.’
He then addressed his first-born, Hasan (‘a), thus: ‘My son, if I survive this wound, I will mete out justice to him. However, if I die, strike him but once, for he struck me but once, with the same sword. Do not cut off his nose, ears or tongue. The Holy Prophet (s) clearly forbade it, saying, “Avoid mutilating anyone as a punishment, even if it be a mad dog.” Look after your prisoner’s needs. Provide him with food and drink. See that he does not face any problem in my house.’
After Imam Ali (‘a) passed away, Ibn e Muljim was struck only once by the same sword that he had prepared for himself. He died on the spot.
Reference : Anecdotes of The Ahlul Bayt (Daastaan e Raastaan ) by Ayatullah Murtadha Mutahhari