During one of the prior ages, the goddess Sri-Lakshmi abandoned the gods for their overindulgence and neglectfulness. Without Sri, a great dark gloom descended on both heaven and earth. The divine ones learned that the goddess could be brought back only through a penance that involved the churning of the milky ocean.
A phenomenal effort was necessary to churn the milky ocean, requiring all the gods and demons to accomplish it. Vishnu himself assumed the avatar of a tortoise. This enabled him to hold the cosmic mountain Mandara in place and to prevent it from sinking while the ocean was churned. The celestial snake, Vaasuki, coiled around the Mandara mountain. The gods pulled one end of the snake while the demons pulled at the other and in this way, the ocean was churned.
Shortly thereafter, Sri-Lakshmi erupted out of the ocean, accompanied by the moon god Chandra. She then summoned all the planets and stars from the ocean depths and sent them into the skies. Then she called forth a great number of celestial gifts. The celestial cow. The sacred gem. The divine elephant. The divine bow and the divine conch.
Yet the story does not end here. With Sri restored, the gods and demons continued churning the ocean for Amrita, the nectar of life and immortality. But as they continued churning, the ocean released a powerful poison which gave off toxic fumes. The gods and demons appealed to Shiva for help and without hesitation, Shiva consumed the poison. It was then that the divine physician, Dhanvantari, rose out of the waters bearing the celestial pot of Amrita. The demons immediately began drinking all the nectar but Vishnu intervened. Taking the form of an enchantress, he charmed the Amrita away from the demons and served it to the gods. Vishnu thereby protected the universe from the calamity that would have occurred if only demons were immortal.