According to legend, Sarpa Satra or Snake sacrifice was a yagna performed by Emperor Janamejaya of the Kuru empire who had ascended to the throne of Hastinapura upon the death of his father Parikshit. The legend states that Parikshit, the lone descendant of the House of Pandu, son of Abhimanyu and grand son of Arjuna of the Mahabharata fame, had died of snakebite. He had been cursed by a sage to die so, the curse having been consummated by the serpent-chieftain Takshaka. Janamejaya bore a deep grudge against the serpents for this act, and thus decided to wipe them out altogether. He attempted this by performing a great Sarpa Satra – a sacrifice that would destroy all living serpents. At that time, a learned sage named Astika, a boy in age, came and intervened to stop the yagna; Astika's mother Jaratkaru also known as Manasa was a Naga and father was also Jarakaru, a saintly Brahmin. Janamejaya had to listen to the words of the learned Astika and set Takshaka free. He also stopped the massacre of the snakes (Nagas) and ended all the enmity with them. From then onward the snakes (Nagas) and Kurus lived in peace.
The earliest background to this revengeful act of the snake sacrifice or Sarpa satra to kill snakes is traced to Arjuna, father of Abhimanyu and grandfather of Janamejaya who had caused the death of the wife of the snake chieftain Takshaka and millions of other living beings when he set fire to the rainforests to establish the kingdom of the Pandavas at Indraprastha.
According to Mahabharata legend, snakes were cursed by their mother Kadru when they refused to obey her request to cheat by turning the tail of the white horse Ucchashrava to a black colour to win a bet against her sister Vinita. Then her sons led by Vasuki held deliberations on the way to stop the snake sacrifice or Sarpa Satra yagna that may be initiated by Janamajeya to kill the race. Takshaka was also one of Kadru's sons who had opposed his mother's request. He had been thrown out of the house by his mother. He then moved out to form his own band of snakes.