After the death of Parikshit, his son Janmejaya became the king of Hastinapur. Janmejaya wanted to avenge his father's death and wanted to kill Takshaka. He decided to organise a snake sacrifice. Accordingly, a sacrificial fire was burnt where the holy priests chanted the names of different snakes.
As a result, the snakes became powerless and fell into the sacrificial fire one by one and perished. The great snake sacrifice continued for many days and hundreds and thousands of snakes emerged from everywhere and surrendered to the sacrificial fire. Everyone waited for Takshaka but he was missing. Everyone, including the priests and Janmejay were puzzled, as they did not know that Takshaka had gone to Indra for protection.