The avatara (God taking human form) of Dhanvantari appeared billions of years ago. Although an avatara is unborn, He takes His divine birth among the living beings to display His divine pastimes. The First Appearance of Dhanvantari In this epoch , He first appeared during the great churning of the cosmic milk ocean to deliver amrta (nectar) for the nourishment of the demigods.
The churning of the milk ocean (Samudra manthanam) is one of the most famous episodes in Puranic history and is celebrated in major way every twelve years in the festival known as Kumbha Mela. The story is related in the Srimad Bhagavatam, a major work that describes the avataras in great detail. Here is what happened: The great leader of the demigods Indra was riding on his elephant, when he came across Durvasa Muni.
Seeing the great demigod, Durvasa offered him a special garland (mala). Indra accepted this garland and put it on the trunk of the elephant. The elephant threw the garland onto the floor, thus enraging Durvasa Muni. In a fit of anger, the sage explained that the garland was the dwelling of Sri (fortune) and was therefore to be treated as prasada.
Therefore cursed Indra and all the demigods to be bereft of all strength, energy, and fortune (Sri). In the ensuing battles, the demigods were defeated in battle and the demons headed by Bali gained control of the universe. The demigods sought out the help of Lord Vishnu, who instructed them in the art of diplomacy. The demigods then entered into an alliance with the demons to jointly churn the ocean for the nectar of immortality and to share it among them