The Purans contain many stories and legends describing the origin of this Maha Shivratri festival. According to one, during the samundra manthan, a pot of poison merged from the ocean. This terrified the gods and demons as the poison was capable of destroying the entire world.