Krishna encountered many people during his life on earth. He was a reincarnation of Lord Vishnu who had taken birth on earth for a purpose of freeing the world from evil and establishes goodness around. One such incident was when he killed Keshi.
Keshi was sent by Kansa, Krishna’s maternal uncle who wished to kill Krishna right from his birth because he had been told by his astrologers and future seekers that Krishna would kill him one day.
So, Kansa sent Keshi to Vrindavan assigning him with the task of killing Krishna. He took the form of a horse with long mane. One reaching Vrindavan he began screaming like the thundering of the clouds (Megha-garjanam). The entire population of Vrindavan grew extremely scared and shocked with such a sight. They all rushed towards Krishna for shelter and protection who took them to his rescue.
Krishna stood in front of Keshi who in turn hit him with his legs. However, the blow did not affect Krishna. The latter took Keshi by his legs and swirling him round and round, threw him away high up in the air. When the Keshi tried to counter hit Krishna, he caught him by his tail and again swirled him into the air. He gave him a blow with his punch. The fight continued for some time in the sky and finally Krishna threw Keshi on the ground.When Keshi opened his mouth to swallow Krishna, the Lord put his hand inside and closed the Navarandhrams of Keshi which made its stomach to burst. A divine soul appeared from his body and praised the lord.
He revealed the true self of Keshi. When Lord Indra killed Vrutrasura, he got the sacrilege of Brahma-hatya. However, in order to get rid of this sin, he performed Ashvamedha Yajna. However, one of the disciples of Indra stole the sacred horse. Indragave a curse to him to become a monster in the form of a horse. When the disciple repented for his deed, Lord Indra told him that he would get salvation from this form only when Lord Krishna would touch him with his feet.
Hence. Lord Krishna freed Keshi from his cursed form by killing him