After Hiranyakashipu's elder brother Hiranyaksha's death at the hands of the Varaha avatar of Vishnu, Hiranyakashipu comes to hate Vishnu.
He decides to kill him by gaining mystical powers, which he believes Brahma, the chief among the devas, will award to him if he undergoes many years of great austerity and penance, just as Brahma awarded powers to other Rakshasas.

This initially seemed to work as planned, with Brahma becoming pleased by Hiranyakashipu's austerities.
Brahma appears before Hiranyakashipu and offers him a boon of his choice.
But when Hiranyakashipu asks for immortality, Brahma refuses.
Hiranyakashipu then makes the following request: 
O my lord, O best of the givers of benediction, if you will kindly grant me the benediction I desire, please let me not meet death from any of the living entities created by you.

Grant me that I not die within any residence or outside any residence, during the daytime or at night, nor on the ground or in the sky.
Grant me that my death not be brought by any being other than those created by you, nor by any weapon, nor by any human being or animal.

Grant me that I not meet the death from any entity, living or nonliving.
Grant me, further, that I not be killed by any demigod or demon or by any great snake from the lower planets.
Since no one can kill you in the battlefield, you have no competitor.
Therefore, grant me the benediction that I too may have no rival.
Give me sole lordship over all the living entities and presiding deities, and give me all the glories obtained by that position.
Furthermore, give me all the mystic powers attained by long austerities and the practice of yoga, for these cannot be lost at any time.

In other Puranas, many variations of the boon are given.
The Shiva Purana mentions that Hiranyakashipu asked Brahma that he would be invulnerable to dry or wet weapons, thunderbolts, mountains, trees, missiles or any form of weapon.
The Vayu Purana mentions that Hiranyakashipu asked to be so powerful, only Vishnu would slay him.
Other variations include not being slain by any living being, not at daytime or nighttime and not above or below.

In section 14, the Anusasana Parva of the Mahabharata, the Sage Upamanyu briefly mentioned to Krishna that Hiranyakashipu also performed another penance to please Lord Shiva.
Shiva granted Hiranyakashipu the boon that he would have unrivalled combat prowess, exceeding skill in the use of bow and other weapons as well as the powers of all the gods, including Indra, Yama, Kubera, Sūrya, Agni, Vayu, Soma and Varuna.

In consequence of these two boons, Hiranyakashipu become so mighty that he was able to shake the very Himalayas down to their roots.
Ravana once tried to lift Hiranyakashipu's earrings but he was unable to do so because they were very heavy.

The Brahmanda Purana mentions that Hiranyakashipu ruled for 107,280,000 years (more than 24 Mahayugas).
After Hiranyakashipu's elder brother Hiranyaksha's death at the hands of the Varaha avatar of Vishnu, Hiranyakashipu comes to hate Vishnu. He decides to kill him by gaining mystical powers, which he believes Brahma, the chief among the devas, will award to him if he undergoes many years of great austerity and penance, just as Brahma awarded powers to other Rakshasas.
This initially seemed to work as planned, with Brahma becoming pleased by Hiranyakashipu's austerities. Brahma appears before Hiranyakashipu and offers him a boon of his choice. But when Hiranyakashipu asks for immortality, Brahma refuses. Hiranyakashipu then makes the following request: 
O my lord, O best of the givers of benediction, if you will kindly grant me the benediction I desire, please let me not meet death from any of the living entities created by you.
Grant me that I not die within any residence or outside any residence, during the daytime or at night, nor on the ground or in the sky. Grant me that my death not be brought by any being other than those created by you, nor by any weapon, nor by any human being or animal.
Grant me that I not meet the death from any entity, living or nonliving. Grant me, further, that I not be killed by any demigod or demon or by any great snake from the lower planets. Since no one can kill you in the battlefield, you have no competitor. Therefore, grant me the benediction that I too may have no rival. Give me sole lordship over all the living entities and presiding deities, and give me all the glories obtained by that position. Furthermore, give me all the mystic powers attained by long austerities and the practice of yoga, for these cannot be lost at any time.
In other Puranas, many variations of the boon are given. The Shiva Purana mentions that Hiranyakashipu asked Brahma that he would be invulnerable to dry or wet weapons, thunderbolts, mountains, trees, missiles or any form of weapon. The Vayu Purana mentions that Hiranyakashipu asked to be so powerful, only Vishnu would slay him. Other variations include not being slain by any living being, not at daytime or nighttime and not above or below.
In section 14, the Anusasana Parva of the Mahabharata, the Sage Upamanyu briefly mentioned to Krishna that Hiranyakashipu also performed another penance to please Lord Shiva. Shiva granted Hiranyakashipu the boon that he would have unrivalled combat prowess, exceeding skill in the use of bow and other weapons as well as the powers of all the gods, including Indra, Yama, Kubera, Sūrya, Agni, Vayu, Soma and Varuna.
In consequence of these two boons, Hiranyakashipu become so mighty that he was able to shake the very Himalayas down to their roots. Ravana once tried to lift Hiranyakashipu's earrings but he was unable to do so because they were very heavy.
The Brahmanda Purana mentions that Hiranyakashipu ruled for 107,280,000 years (more than 24 Mahayugas).
Hiranyakashipu