The festival of Janmashtami is celebrated on the eighth day of the Krishna Paksha of the month of Pad. A fast is observed on this day. The Janmashtami Vrat Katha and the story of Lord Krishna's birth are heard at the end of the fast at midnight. Following is the story of Lord Krishna's birth:
According to Skanda Purana, during the Dwapar era, King Ugrasena ruled in Mathura. King Ugrasen was crowned by his own son Kansa. Kansa had a sister Devaki, who was married to a Yaduvanshi chieftain named Vasudeva. Kansa loved his sister Devaki a lot. When Devaki was married to Vasudev ji, Kansa himself went to the chariot to bid farewell to his sister-in-law. But as soon as Kansa chanted a chariot, "O Kansa, the eighth son of the god whom you are going to bid farewell to will kill you."
Hearing this, Kansa became enraged and tried to kill Devaki. Kansa thought that if I kill him, he will not have a son nor will I perish. Seeing Kansa doing this, Yaduvanshi got angry and the birth anniversary of the fierce Yughavan Sri Krishna is celebrated as Janmashtami. Every year a situation of Bhadrabdha arose. Although Vasudev did not want war.
Vasudev told Kansa that you have no need to fear Devaki, when the time comes, I will hand you the eighth child of Devaki himself.
Kansa's anger subsided at his persuasion. Kansa knew that Vasudev did not lie. Kamsa agreed to Vasudev ji and locked Vasudev and Devaki in prison and got them strictly guarded.
As soon as the child was born, there was a sudden light and Lord Vishnu appeared in front of him, he told Vasudev that I was born as your child in child form. Just leave me at the time of your friend Nandji's house in Vrindavan and bring the girl born to him to Kansa.
Hearing this order, Vasudev left the prison after putting the newborn baby in the soup and crossed the bottomless Yamuna and reached Nandji's house. Seeing the miracles happening on the way, he was very stunned as the guards slept on their own, the fetters lying in their hands opened, the swollen Yamuna river was also giving way for them. After crossing the Yamuna river, Vasudev put the newborn child to sleep with Yashoda and came to Mathura with the girl.
When Kansa came to know that Vasudev-Devaki had been born a child, he went to the prison and snatched the newborn girl from Devaki's hand and slammed it on the earth, but the girl flew into the sky and said 'Hey fool, kill me what will happen? The one who killed you has reached Vrindavan. He will soon punish you for your sins. ' Kansa became very angry on hearing this. He tried to kill the child Krishna several times but could not do so, finally when Lord Krishna reached puberty, he killed Kansa.