The Devas were harassed by Asuras (Demons). They could not stand before the strength of the demons. The Asuras formed two-thirds of the population, whereas the Suras (Devas) formed only one-third. Naturally the Asuras has the upper hand always. So, the Devas went to Brahma and told him about their plight. Brahma took all of them to the adobe of Sri Maha Vishnu.
Maha Vishnu was in his meditative slumber (Yoganidra) and actually was thinking about the plight of the Devas and in fact, wanted to find a permanent solution for this sorry state of affairs. Just then, Brahma was introduced to the audience of Sriman Narayana who was lying on his cosmic bed Anantha.
Brahma after obeisance told Maha Vishnu of what all the Devas had told him. Maha Vishnu said, 'I see your pitiable plight. I will give you a solution. Act accordingly. Be friendly with the Asuras first. With their co-operation, get the ocean of milk churned and you will get, from the ocean many precious things, you will also get Amirtha (nectar). If you take a dose of Amirtha, you become immortal. Then the question will be solved because you would have conquered death. Brahma said, 'Lord, alone the Devas cannot get the work done. They have to elicit the co-operation of the Asuras as you have directed. If the Asuras come to know of Amirtha, I fear, Lord, how things will take shape'.
Maha Vishnu replied, 'My children, you don't worry about it. Leave that to me and I shall manage. Note that the demons shall toll and you shall reap the fruit'.
With the mountain Mandara as the churning rod and the great serpent Vaasuki as the rope; the churning of the ocean began.
As they were churning, the mountain began to sink slowly and at a stage the churning stopped. The Lord of the Universe saw this and took form of a wonderful huge tortoise (Koorma) dived into the waters and gave his strong shell on his back as a support to the mountain. Now the mountain became steady and again the churning began.
The first that came out of the ocean was Kamadhenu, the divine cow. Maha Vishnu gave this divine animal to sage Vasishta. Then came Paarijatha tree. Devendra took it and it adorned his park(Nandavana). This was followed by the Moon and then the precious diamond Kaustubha. This Moon had its place on the head of Lord Shiva. Kaustubha was appropriated by Maha Vishnu himself.
As the Moon adorned the head of Lord Shiva, the latter came to be known as Sasidhara. Then came Iravatha (White Elephant). Indra took it for his use.
After some time the deadly poison Haalahala (terribly destructive poison) came and scorched the whole universe. All ran helter-skelter. They fell at the feet of Lord Shiva who saved the universe by drinking the poison. As Lord Shiva swallowed the poison saying Sriman Narayana Preethyartham (to the pleasure and satisfaction of Sriman Narayana) the poison got stuck in his throat and could not go down the alimentary canal, making his neck dark-blue. So He was known as Neelakanta.
Next to appear from the Milky Ocean were Sri Mahalakshmi, Amirtha and several other precious things. Lord Vishnu accepts Goddess Lakshmi as his wife.
The Devas and Asuras continued the churning. Finally Dhanvantari emerged from the sea. Dhanvantari is the divine physician. He had a Kalasha (sacred pot) contained Amirtha. The demons are the first ones to notice the Kalasha and they snatch it away from Dhanvantari. Immediately the Devas ran to Lord Vishnu, and requested Him to devise a plan to retrieve the Kalash for them.
Lord Vishnu changes into his 'Mohini' form of a beautiful woman. As she was so graceful and beautiful, the demons could not stop looking at her.
Mohini successfully obtained the Amrutha Kalash from the demons assuring them that she would fairly distribute the Amrutha among the Devas and the Demons.