Maharshi Kashyapa and his wife, Diti, had three children: Hiranyaksha, Hiranyakashipu, and Holika, who were the first of the race of daityas (meaning "children of Diti")—powerful beings often considered demons.
Hiranyaksha and Hiranyakashipu were avatars of Jaya and Vijaya—the gatekeepers of Vaikuntha (the abode of Lord Vishnu)—born as demon twins on Earth in the Satya era as a result of the Kumaras' curse. Though they were twins, Hiranyakashipu is regarded as the elder of the two as he was born first. After they grew up, Hiranyakashipu and Hiranyaksha ruled over the demons. One day, Hiranyaksha stole the Earth and submerged her in the cosmic ocean. Vishnu assumed his Varaha (Sanskrit for "boar") avatar to kill Hiranyaksha and rescue the Earth. When Hiranyakashipu learned of his younger brother's death, he vowed revenge against Vishnu.
Kayadhu, Hiranyakashipu's wife, informed him she was pregnant. Following the advice of Shukracharya, the daitya guru, Hiranyakashipu decided to pray to Lord Brahma for immortality. He entrusted his Prime Minister, Vidal, with Kayadhu’s care during his absence.
Terrified at the prospect of Hiranyakashipu pleasing Brahma and becoming immortal, Indra and the other gods tried to disturb his penance. Agni, the fire god and deity of sacrificial rituals, attempted to burn Hiranyakashipu, but Shukracharya thwarted his efforts. Then Varuna, the rain god and ruler of the celestial waters, unleashed a torrential downpour on the daitya, but Shukracharya again saved his disciple. Indra, the king of the gods, then attempted to kill Hiranyakashipu himself, but his efforts also proved futile against Shukracharya’s powers.
Frustrated, Indra decided to target Hiranyakashipu’s unborn son instead. He ordered Agni to burn the innocent baby, but Lord Vishnu intervened and saved the child. Indra then stormed into Hiranyakashipu's palace to abduct his wife, Kayadhu. Entrusted with her safety, Prime Minister Vidal fought Indra but perished. Indra then carried Kayadhu away, planning to imprison her and kill her son upon birth. However, Narada, the divine sage of the gods, intercepted Indra and convinced him that his actions were immoral. He persuaded Indra to release Kayadhu and took her to his ashram.
Brahma finally appeared before Hiranyakashipu and asked him to make a wish. Hiranyakashipu first wished for immortality, but Brahma declined, saying that every creature born must eventually die.
Hiranyakashipu then wished that he would be killed:
neither by a human nor by an animal,
neither on the earth nor in the sky,
neither inside nor outside a house,
neither during the day nor night,
and not with a weapon.
Brahma granted this boon, and Hiranyakashipu believed himself invincible, though Brahma knew a loophole lay hidden within the conditions. Empowered by his newfound protection, Hiranyakashipu declared himself God and demanded worship.
Upon returning to his palace, he discovered that Kayadhu was missing. Shukracharya informed him of what had transpired. Furious, Hiranyakashipu stormed the heavens, defeated Indra’s army, and demanded to know his wife’s whereabouts. Narada informed him that Kayadhu was staying at his ashram.
Narada escorted Hiranyakashipu to his ashram, where he reunited with Kayadhu. She expressed her desire to give birth to her child in the ashram. Kayadhu soon went into labor and gave birth to a son. Narada named the boy Prahlada and requested that Kayadhu and Prahlada remain at his ashram for a while longer. Hiranyakashipu agreed. At the ashram, Prahlada grew into a handsome young boy, and Narada taught him about Lord Vishnu. Eventually, Narada advised Prahlada and Kayadhu to return to Hiranyakashipu’s palace, where they received a warm welcome.
Shukracharya then took Prahlada to his ashram to train him in the ways of the demons. However, Prahlada refused to recognize Hiranyakashipu as God and continued to worship Vishnu. He also refused to learn combat, believing martial arts predisposed the soul toward violence. The teachers at the ashram soon deemed him a bad influence on the other daitya students.
Prahlada’s unwavering devotion to Lord Vishnu enraged Hiranyakashipu, who ordered that the boy be put to death. Hiranyakashipu's soldiers tried to have Prahlada trampled by elephants, but Lord Vishnu saved him in the nick of time. They then hurled him off the top of a cliff, but Vishnu saved him again. Their attempt to poison him also failed.
Hiranyakashipu’s sister, Holika, had been granted a boon that rendered her immune to fire. She attempted to use this boon to kill her nephew by sitting with him in her lap on a burning pyre. However, since she used her power for evil, the boon failed, and she was burned alive while Prahlada emerged unscathed. Holika’s burning is commemorated annually as Holi, the Hindu festival of colors, symbolizing the triumph of good over evil.
Hiranyakashipu, now blaming Vishnu for his sister’s death, became even more enraged. He resolved to kill Prahlada himself.
"Prahlada, where is your Lord Vishnu? If he is everywhere, why is he not present before me in this pillar?" he asked.
"He is in the pillar, just as in the slightest dust," Prahlada calmly replied.
Unable to contain his fury, Hiranyakashipu struck the pillar with his mace. A deafening sound followed, and from the shattered pillar emerged a creature with the body of a man and the face and claws of a lion. Neither human nor animal, he seized Hiranyakashipu and placed him on his lap—neither on the earth nor in the sky, at the threshold of the courtyard—neither inside nor outside a house, at twilight—neither day nor night. Then, with his claws and not a weapon, he killed Hiranyakashipu by disemboweling him. Thus, Brahma’s boon was not violated.
The beast was an avatar of Vishnu, now known as Narasimha (Sanskrit for "man-lion"). Even after slaying Hiranyakashipu, his anger did not abate. The gods, fearing the destruction of the universe, pleaded with him to calm down but to no avail. They then requested Prahlada to try. This worked and Vishnu returned to his usual form. Prahlada was later crowned king of the daityas and, unlike his predecessors, ruled with wisdom and justice.