According to the traditional Hindu texts, Kansa, the tyrant ruler of Mathura, was the cousin brother of Devaki. Guided by a divine prophecy that he is destined to die at the hands of the eighth child of Devaki, he captivated her in a cell, along with her husband Vasudeva, with their hands and feet tied with iron chains, and cruelly killed all their six children one by one. However, the divine power intervened before the birth of the seventh child when at the instance of Lord Vishnu, goddess Mahamaya transferred the fetus from Devaki’s womb to that of Rohini, the first wife of Vasudeva who gave birth to Balarama in Gokul. When Devaki gave birth to her eighth son, Krishna, an incarnation of Lord Vishnu, Mahamaya took birth to Yashoda, wife of Nanda, in Gokul.
It was a stormy night, and all the guards of the prison in Mathura were made unconscious in sleep by the divine spell to make the situation advantageous for Vasudeva. To make full use of the gifted opportunity, Vasudeva took his new-born son from the cell, crossed River Yamuna to reach Gokul, and swapped the boy for the girl. The next morning, despite Kansa found a girl instead of a boy, he grabbed the baby to thrash and kill it.
However, a miracle happened at that moment when the baby-girl slipped from his grasp, rose high up, took the shape of goddess Mahamaya in full glory, and laughingly pronounced that the child he intends to kill is growing up in Gokul to kill him in due course.
Kansa became enraged as he was made a fool by the tricks of the gods and became more apprehensive about his life as his destined slayer remained out of his reach. However, he did not give up and engaged Putana, the female demon, known as the killer of infants, to annihilate Krishna. To fulfill her task, Putana took the disguise of a beautiful woman before visiting the house of Yashoda and expressed her desire to take baby Krishna on her lap and breast-fed him.
Stunned by her beauty and feeling pity for her apparently genuine appeal, Yashoda agreed to her proposal. However, as an incarnation of Lord Vishnu, Krishna knew her intention beforehand, and as Putana took him on her lap and offered him one of her nipples, smeared with poison, he squeezed her ample breasts forcefully, and sucked away her life force, along with all of her milk. Putana screamed and cried in pain, begged in vain for mercy, and pleaded to be released. Finally, she ran out of the house with Krishna still clinging to her breasts, and fell dead with her body returned to her huge demonic form.