Lord Vishnu appeared in the form of a Boar in order to defeat Hiranyaksha, a demon who had taken the Earth (Prithvi) and carried it to the bottom of what is described as the cosmic ocean in the story. The battle between Varaha and Hiranyaksha is believed to have lasted for a thousand years, which the former finally won. Varaha carried the Earth out of the ocean between his tusks and restored it to its place in the universe. Vishnu married Prithvi (Bhudevi) in this avatar.