One day the gods (Devas) in heaven looked down and saw that demons (Asuras) from the underworld had invaded the earth and were hurting the people who lived there. The gods came down to protect the people and tried to push the demons back into the underworld. The demons fought back and a war started. This war lasted for a thousand years without either side gaining an advantage.
After fighting for a thousand years the gods realized there would never be a winner in this war unless a different strategy were used. They went to heaven and approached their father, the creator god Brahma. Brahma agreed with the gods about the futility of the struggle with the demons, but could not provide a course of action. Together with the gods, Brahma went to a higher heaven and approached the great god Vishnu.
Upon hearing of their struggles, Vishnu instructed the gods to go to the center of the universe and churn the ocean of milk (Kshira Sagara) they found there. Instead of butter, the nectar of immortality
(Amrita) would rise out of that ocean. If the gods drank that Amrita they would become immortal and could not be killed by the demons. Then they could fight with abandon and force the demons into the underworld and free the earth from their influence.
The gods were elated and quickly rushed to find the ocean of milk. They were heart broken when they saw its immense size and realized there were not enough gods to churn it. After much discussion the gods concluded the only way to churn the milky ocean was to ask the demons to help them. The demons could be promised a share of the nectar as a reward. However, after the ocean was churned the demons must be deceived, because if the demons drank Amrit the battle would only continue at a more intense level.
The gods and demons gathered on the shores of the milky ocean and performed Vedic rituals to ensure their success. They made offerings into a sacred fire and sprinkled the milky ocean with rice and flower petals. After completing these initial activities everyone became quiet as they realized they did not know how to begin to actually churn the ocean. A celestial voice spoke from the sky and instructed them to take the tallest mountain in the world, a mountain called Mandara, and place it in the ocean as a churning rod. The gods and demons quickly brought the mountain and set it in the water. Immediately the mountain began to sink. God Vishnu took the form of a turtle (Kurma Avatara) and dove under the mountian. He lifted it to the correct hight and held it there.
The celestial voice spoke again, telling of a deep cave where the longest snake in the world resided. They were to capture this snake (Vasuki) and use it for a churning rope by wrapping it around the mountain. The gods and demons quickly caught the snake and wrapped it three and a half times around the mountain. An argument arose between the demons and gods as to which would hold the snakes head as holding its tail was considered an impure act. The gods deferred and held the tail and the churning began.
The gods and demons pulled the snake back and forth causing the mountain to turn and agitate the waters of the ocean. The snake, squeezed against the mountain and being stretched by the pulling began to spit fire from its mouth that burned the demons. So the churning began. Treasures from the depths of the ocean began to rise to the surface. Lakshmi arose from the waters and flew off to take a place in heaven as the goddess of wealth. The celestial dancer Rambha and Uchchaisravas the flying horse also arose and flew off to heaven. A beautiful jewel splashed to the surface and was claimed by Vishnu as an adornment. Parijata the wish fulfilling tree and Surabhi, the cow of plenty came next. Then, Airavata a flying elephant, a beautiful conch shell and a mighty bow. All these treasures were claimed by individual gods.
Suddenly from the frothing ocean a black cloud arose that proved to be deadly poison. The cloud began to drift toward the shore killing every living thing that touched it. The gods and demons dropped the snake and ran from the cloud. The currents of wind propelled the cloud toward the running gods and demons and as fast as they could run it steadily grew closer. Realizing they had no hope they all knelt and prayed. They gave up their individual wills and surrendered to divine will and opened to their destiny. The great god Shiva appeared and stood in front of the poison cloud. Using his hands he scooped the poison into his mouth and swallowed it. The poison was so toxic that it burned his throat blue but could not do more harm to the god. After drinking the poison, Shiva flew away.
The gods and demons resumed their efforts to churn the ocean. Soon the celestial physician Danvantari appeared carrying the Amrit in a golden vessel. The demons grabbed the vessel and ran away. The terrified gods prayed to Vishnu and he appeared in the midst of the demons as Mohini (Enchantress/Maya).
The demons were fighting amongst themselves over who should have the first drink. When they say Mohini they were all infatuated by her and agreed that she should drink the Amrit first. They handed her the vessel and she flew away to give it to the gods.
The gods drank the Amrit and were able to push the demons back into the underworld and make the earth a safe place for humans to live.