Vasudeva was the son of Shura, (a noble man in Mathura). He married Devaki and was returning home in the chariot.
Prince Kamsa was the eldest son of Ugrasena, the then ruler of Mathura. Out of affection for his cousin Devaki, he drove the chariot himself. As the marriage procession was on its way, a celestial voice addressed Kamsa: "O foolish one, the eighth child of this girl whom you are now conducting will slay you."
Kamsa seized Devaki by the hair and with a raised sword, proceeded to kill her. The blessed Vasudeva, in order to gain
time, tried to appease Kamsa with words of praise and said: " O virtuous one, Devaki is like your daughter. There can be no fear to you from this girl. The incorporeal voice had said that only the eighth child will kill you. So I shall accordingly make over her sons to you, which is cause of your fear."
Kamsa applauded Vasudeva, and desisted from killing his sister. Vasudeva, truthfully handed over his first born son Kirtiman to Kamsa. Kamsa smilingly spoke: "Please keep the boy under your protection. My death has been decreed at the hands of your eighth progeny."
Narada, wanting to hasten the avatara of Vishnu, communicates to Kamsa: "The vrshnis, led by Vasudeva, Nanda of Vraja, and Devaki of the yadavas who are devoted to you, are all gods themselves who have descended on earth, for the destruction of the daityas." Kamsa, overcome with fear, did to death all the six sons of Vasudeva. He binds Vasudeva and Devaki in fetters in their own residence and also imprisoned his own father Ugrasena, and ruled the Surasena territory himself.
Lord Anantha, a ray of Lord Vishnu enters the womb of Devaki as her seventh son. The Lord commanded Yogamaya, (his transcendent creative energy): "Proceed to Vraja, where Rohini, Vasudeva's another wife, is staying in Nanda's Gokula in hiding. There exists in Devaki's womb, my own part manifestation as Sesha (the serpent god). You shall transfer it in Rohini's womb. You will be born of Yashoda, the wife of Nanda." Yogamaya carries out the command.
Kamsa, awaiting the birth of the eighth son of Devaki, thought of the Lord, when he was sitting, standing, walking, lying down, taking food. He saw the world full of him, out of fear.
At midnight, when the star Rohini was ascendant, on the eight day of the Lunar calendar, Krishna was born. Vasudeva beheld that boy, charming, endowed with four arms which wielded the conch, discuss, lotus and the mace, adorned with yellow silk, looking like a dark cloud laden with moisture. Vasudeva's fear was completely gone. He extolls the Lord. The Lord then assumes the form of an ordinary child, his parents gazing in wonder. The child asks Vasudeva to take him to Nanda's house in Gokula, and bring back their baby girl. Vasudeva does as he was told. Miraculously, the prison doors unlatch, their fetters loosened, and Vasudeva stepped out with the child while the guards slept. The torrential downpour increased the level of the Yamuna, but it makes way for Vasudeva.
He reaches Gokula where everyone was asleep. Vasudeva exchanged the babies and returned. Yashoda was rendered unconscious by Yogamaya, hence did not know the gender of the child which she gave birth to.