About five and a half thousand years ago, there ruled in Mathura in the modern day Indian state of Uttar Pradesh a despotic king known as Kans. The people of the city had a trying time bearing the whims and oppression of their tyrannical ruler. Kans had overthrown his own father Ugrasena to gain access to the royal throne and was infamous for his fierce ambition that spared none, not even his loved ones.
But even the fearsome Kans had a soft corner for his cousin Devaki, whom he loved very much and wanted to marry her off to a decent man. Soon the day of Devaki's marriage came near and King Vasudeva of the Yadu dynasty won her hand. But when the marriage ceremony was almost complete, the great sage Narada told Kans that he would die in the hands of the eighth child born of Devaki and Vasudeva. This filled Kans with anxiety and anger and he proceeded to kill his beloved cousin in fear for his own life. Then Vasudeva pleaded with the tyrant and promised to surrender every one of the children born to them to Kans. Being fond of his sister and pleased with this agreement, Kans forced the newly wed couple to live in his palace prison as captives till their eighth child was born. This was soon carried out and the duo were under constant watch by the royal guards. Each time a child was born to the couple, Kans would personally pay a visit to their cell and smash the head of the infant on the prison wall unmoved by the heartbreaking cries of Devaki and the entreaties of Vasudeva. He did this for seven times until nine years had passed and Devaki was to have a baby for the eighth time.
But the night the eighth child was about to be born, a miracle happened. All the guards magically went to sleep, the doors of the prison opened by themselves and the shackles of Vasudev and Devaki opened by themselves and dropped to the ground. Soon Devaki gave birth to a baby. The child was very dark in complexion but a beautiful boy beyond comparison. As Vasudeva marvelled at his new-born child, a voice from the sky (akashvani) ordered him:
"O Vasudev, take your child to the Gokul kingdom, ruled by your friend King Nanda. Nanda and his queen Yashoda has just given birth to a daughter. Exchange your son for their daughter. They are asleep and will not know about the exchange. Take their little girl and return to the prison immediately. Make haste or else Kans will come to know about the birth of this child and kill it. This child has been born to subjugate all evil and protect the innocent. He will even save you one day. Now hurry before it gets too late".
The Gokul kingdom was across the river Yamuna, which flowed near the city of Mathura. Vasudev knew that he had to carry his baby. Suddenly his eyes caught the sight of a "chhaaj" (reed contraption by which all foreign matter is removed from any lentil, rice, wheat etc.). He cleared the dirt from it, placed his little baby in the basket and took him to the banks of the great river Yamuna. It being the rainy season, the river was in full spate, and it was still raining. On stepping into the river, poor Vasudev had more than half of his body submerged in the water. He tried to save the baby from the rising river by holding him higher and higher. But there was no way he could shield it from the torrential rain. Then, he saw a huge five-mouthed snake following him from behind and providing a canopy over the baby with its hood. The sight struck fear in the heart of Vasudev, but then he remembered the akashvani, which is the voice of angels, andz he was reassured that he and his baby was being protected and that he would surely reach his destination.
At Gokul, Vasudev entered the house of his friend Nand, who was asleep and so was his wife Yashoda, and so were all the attendants. He saw a sweet baby near Yashoda and quickly scooped it in his arms after placing his own son in the empty space next to Yashoda.
With Sheshnag assisting him like before, Vasudev returned to the prison with the girl-child. He entered his dark cell and laid the baby by Devaki's side. Soon the shackles were back in place, the doors shut and the guards woke up.
On seeing the baby, the attendants rushed up to their master Kans to give him the news. Kans came in a great hurry, Because it was the eighth child. He picked up the baby and threw it against the wall, but the little girl flew up into the air. With a blinding flash of light, the baby took the form of a fierce goddess sky, who taunted Kans:
"O Kans, your destroyer has already been born, and is elsewhere. He is now well and alive in a safe place. And one day, he will come in search of you and kill you! You can not change your destiny, how hard you may try!"
Along with the sound of laughter, the goddess disappeared leaving behind the dumbstruck Kans. This little girl has come to be worshipped under various names - Durga, Tara, Ishani and Mandakini.
This legend of the birth of Lord Shrikrishna is recounted on every Janmashtami and the praises of the friend-god are sung in almost every temple dedicated to the divine being. Pious Hindu's hold this account of the birth of the Lord very dear to their hearts.