Imam Ali (A.S)
In the battle of ditch (Khandaq), the Muslims dug a ditch around themselves for their defense, so that the enemy could not get across. A man from the enemy side called Amr bin Abdawud who was known for his strength, courage and art of fighting managed to get across the ditch.
All the Muslims were terrified to fight him and only Imam Ali (A.S) came forward to fight this man.
There was a fierce fight until at last Imam Ali (A.S) threw Amr down onto the ground and mounted his chest ready to kill him. Just as Imam Ali (A.S) was about to kill this enemy of Islam, he spat on the face of our Imam (A.S).
Everybody was certain that because of this insult, Amr would meet his death even faster still, but to their amazement, Imam Ali (A.S) moved from Amr's chest and walked away.
Amr attacked Imam (A.S) again and after a short while, Imam (A.S) again overpowered Amr and killed him.
After the battle was over people asked Imam Ali (A.S) the reason why he had spared Amr's life when he had first overpowered him. To which Imam (A.S) replied that if he had killed him then it would have not been only for the sake of Allah but also for the satisfaction of his anger and so he let him free.
Then Imam (A.S) controlled his anger and killed Amr purely for the sake of Allah.
Moral: Although your intention may be pure to begin with it can very easily change so always make sure you do things for the sake of Allah only.