Varaha Avatar, the third incarnation among the 10 Dashavatara of Lord Vishnu, is in the form of a Boar.
Varaha is depicted in animal form bearing a boar’s head on a man’s body. He has four arms, two of which hold the wheel and conch-shell while the other two hold a mace, sword or lotus. The tusks of the boar hold the Earth.
The Lord appeared as a boar to defeat Hiranyaksha, a demon, who had taken the Earth and carried it to the bottom of the cosmic ocean. The avatar of Varaha signifies the restoration of the Earth from a pralaya (deluge) and the formation of a new kalpa (cosmic cycle).
According to Hindu puranas, there was a demon named Hiranyaksha, an incarnation of Jaya, who was a gatekeeper of Vaikunta (the abode of Lord Vishnu). He was born as an Asura due to a curse of the twin Rishis known as the Sanat – Kumaras. Hiranyaksha, who became vigorous by the boons obtained from Brahma, had hidden the entire world at the bottom of the ocean to prevent the Devas from becoming powerful. He was told that he was not the most powerful being in the universe, and that Vishnu was stronger. Hence, he searched for Mahavishnu, but could not find him. The demon dropped the whole world into the ocean and the earth sank to the bottom.
Lord Vishnu listened to the pleas of the Devas and took the form a giant boar or Varaha. He dived into the ocean, to bring the earth up which was waning at the bottom of the ocean. Varaha used its tusks to dig it out of the bottom, and carried towards the surface. The enraged Hiranyaksha interrupted the Varaha, and then commenced a battle which is believed to have lasted for a thousand years. Eventually, Lord Vishnu rescued the earth and restored it to its place in the universe. In this avatar, Vishnu married Prithvi (Bhudevi). It is said that Vishnu balanced the earth on his thigh and due to this a son was born to her. Since his son was created when Vishnu had been involved in a battle, he was an Asura who is the famous Narakasura.
Jaya(Hirankasya) was later born as Ravan.
Story of Jaya(Hirankashya)
Once Jaya and Vijaya were guarding Vaikuntha’s seventh gate when four sages arrived and asked to be let in. These four sages were the four sons of Lord Brahma, or the Manas Putras born from his mind.
Jaya and Vijaya refused entry to them saying that their presence was not sanctioned by Lord Vishnu. The sages cursed the heavenly guards to be born as demons for their next 100 births.
Later when the sages met Lord Vishnu, they asked him to revoke their curse as they thought that the punishment was a little too excessive. But Lord Vishnu declined saying that it was not possible for him to revoke the curse entirely.
Lord Vishnu reduced the duration of the curse from a 100 lifetimes to 3 lifetimes. This meant that Jaya and Vijaya would be born as demons for their next three births. They were Hiranyaksha and Hiranyakashyap during their first rebirth, Ravana and Kumbhakarna in the next and, Dantavarka and Shishupal in their last birth.
During all the next three lives of Jaya and Vijaya, they were killed and liberated from their curse by Lord Vishnu through his avatars. Ravana and Kumbhakarna were killed by Lord Rama during the Lanka war.