The story is about the Varaha avatar, which begins with the Doorkeepers of Lord Vishnu. Lord Vishnu lived in Vaikunta, which was guarded by two gatekeepers named Jaya and Vijaya. They loved Lord Vishnu and felt honored to protect him. Many people came to visit Lord Vishnu, and it was Jaya and Vijaya's job to allow every person who had grievances to see the Lord. They knew that Lord Vishnu's time was precious and could not be wasted.
One day, Lord Brahma's four sons came to meet Lord Vishnu at his abode, Vaikunth. Since Lord Vishnu was resting at that time, the two guards, Jaya and Vijaya, stopped them from entering the gates. Lord Brahma's sons were very angry and cursed Jaya and Vijaya to be born as humans on earth. The guards pleaded with them, but Lord Brahma's sons wouldn't listen.
Lord Vishnu arrived at the spot after hearing some noises. He apologized for his guards' actions, saying they were just doing their duty. But the curse could not be taken back, and Lord Brahma's sons left. Lord Vishnu then addressed his guards and said that the curse would be lifted if they, in human forms, would meet their death at his hands. The guards had no choice but to agree to this. Both guards were born as brothers named Hiranyakashyap and Hiranyaksha.
Hiranyaksha was a great devotee of Lord Brahma. He worshiped him for years, and in return, Lord Brahma gave him a boon. According to the boon, no God, human, Asura, devta, animal, or beast would kill him. Hiranyaksha started torturing the people on earth as he was assured of his immortality. His powers grew by the day. He was such a giant that mother earth trembled when he walked, and the sky cracked when he shouted.
He started harassing devtas and invaded Indra's palace. Fearing for their lives, devtas took shelter in the caves of mountain ranges of earth. To harass devtas, Hiranyaksha grabbed earth and submerged it in Patal Lok. Mother Earth sank to the bottom of the ocean.
At that time, Manu and his wife Shatarupa were ruling over the earth. Seeing this, Manu and his wife came to Lord Brahma, bowed, and said, "Father, tell us how we may serve you and ensure our happiness in this world and the next. Where should Shatarupa and I live as Mother earth is submerged in the ocean?" Lord Brahma became worried and thought that mother earth should be rescued. He said, "Hiranyaksha will not be destroyed by me because I have granted him a boon. Let's take the help of Lord Vishnu!"
As Brahma meditated on Lord Vishnu, a tiny boar fell from his nostrils. Wondering what that creature was, it grew and grew till it was the size of a large mountain. It was Lord Vishnu who said, "I will enter into the ocean to lift Mother earth out of it." He took the form of a boar to kill Hiranyaksha because, while getting the boon from Lord Brahma, among all the animals, Hiranyaksha forgot to mention the boar as an animal.
Emitting a terrifying roar, Lord Vishnu, in the form of a boar, took one mighty leap into the air and tore the clouds with its hoofs and dived to the bed of the ocean in search of Mother earth. He reached the other end of the ocean and discovered in its depths Bhoomidevi (Mother Earth).
Meanwhile, Hiranyaksha rushed to the seashore, where he encountered Varuna, Lord of the ocean, and challenged him, "O supreme Lord! O guardian of the whole sphere! Come and have a battle with me." Varuna became very angry as he knew that at this moment, Hiranyaksha was mightier than him. So he curbed his anger and said, "I have given up fighting as I am too old. You must fight with Vishnu; none but he alone would be an equal opponent for you. Go seek him out."
Suddenly, Narad arrived there. Hiranyaksha asked him, "Do you know the whereabouts of Vishnu?" Narad told him that Lord Vishnu was in the ocean rescuing Mother Earth. Angry Hiranyaksha charged towards the ocean-bed.
Meanwhile, the Boar had just dug his tusk into the ocean-bed and lifted Mother Earth onto it, and began rising towards the surface. Hiranyaksha rushed towards him with a mace in his hand saying, "You fraudulent fellow! Where are you carrying away the earth conquered by me? Stop or I'll crush your head with this mace!" He then turned to face Hiranyaksha. The demon threw his mace at the boar, but the boar stepped aside and raised his mace. They fought for a long time with their maces.
Now Brahma warned Vishnu, "You've only an hour before the sunset. Destroy the demon."