The Bhagavata Purana states that Demon Aghasura assumed the form of an enormous serpent. Krishna’s companions, the cowherd boys, entered its mouth, mistaking it for a mountain cavern. After seeing this, Krishna then came to their rescue, killing Demon Aghasura.
The scriptures say that when the boys walked into the cave Krishna became momentarily aggrieved because He knew it was one of Kansa’s tricks. He considered for a moment, and then decided to enter the cave Himself. Demons all over the world became joyful when Krishna went inside. The demigods, who had been hiding among the clouds to see what would happen, became distressed. For a time it seemed as if the snake-demon had killed Krishna, but when Krishna heard the demigods’ pleas He grew larger and choked the demon to death. Demon Aghasura’s life air burst through a hole in his skull and waited there for Krishna to come out, and then it merged into His body. Krishna showed His benevolent nature by rescuing His friends and giving liberation to Demon Aghasura.