Read Narasimha Lila to know how a doorkeeper in Vaikuntha takes birth as demon Hiranyakashipu and is killed by Lord Narasimha.
Sages visit Vaikuntha: Once upon a time, the great sages, Sanaka, Sanandana, Sanatana and Sanatkumara visited Vaikuntha. There are seven gates in Vaikuntha loka and when the sages tried to enter the seventh gate, the door keepers, Jaya and Vijaya stopped them by blocking the way with their staff, and thereby offended the sages. The sages cursed them to take birth in the material world. The door-keepers repented for their mistake.
Jaya and Vijaya cursed: At that time, Supreme Lord Vishnu, appeared there and informed that the punishment given by the sages was actually ordained by Himself. The door-keepers, Jaya and Vijaya would take birth in a demoniac family and they would be firmly united with Him in thought through mental concentration intensified by anger. He also confirmed that they would return to Vaikuntha soon. Thus Jaya and Vijaya took birth in this material world as Hiranyaksha and Hiranyakashipu, the sons of sage Kashyapa and Diti.
Lord Varaha, the boar incarnation: Hiranyaksha was so powerful that he brought all three worlds under his control. He challenged Varuna to fight with him, but Varuna deva directed him to Lord Varaha, the boar incarnation of the Supreme Lord Vishnu. Hiranyaksha was killed in the combat with Lord Varaha. Hiranyakashipu wanted to avenge the death of his brother. To become immortal, he undertook severe penances at Mandarachala to please Lord Brahma.
Hiranyakashipu, the King of Demons: When Lord Brahma appeared in front of him, he asked for immortality. But even Brahma was not immortal. How could he grant immortality to someone? So Brahma agreed to give him any benediction other than immortality. So the demon asked Brahma that he should not be killed by a human being or an animal or demigod or any other entity, living or non-living. He also prayed that he should not be killed at any place, neither in the daytime nor night, by any kind of weapons. He further requested to award him supremacy over the entire universe and perfection in mystic powers. After receiving the benedictions from Lord Brahma, Hiranyakashipu terrorized the entire universe. He conquered the ten directions and brought every one under his control.
Narada saves Kayadhu: When Hiranyakashipu went to Mandarachala to execute severe austerities, his wife, Kayadhu, was pregnant. The demigods headed by Indra attacked the demons and arrested Kayadhu. They wanted to kill the child as soon as it took birth. Narada Maharishi stopped Indra and revealed that the child would be a great devotee of Lord Hari. He took Kayadhu to his hermitage and gave her instructions on spiritual knowledge. The child in the womb of Kayadhu attentively listened to the instructions of Narada Maharishi and became a great devotee of Lord Vishnu.
Prahlada instructs his class mates: The child was named Prahlada. Hiranyakashipu entrusted his son Prahlada, to Chanda and Amarka, the two sons of Shukracharya, for education. They tried to teach him politics, economics and other material activities; but Prahlada did not care for such instructions. He was always meditating on the Supreme Lord. When Hiranyakashipu came to know about this, he was extremely angry and chastised the teachers for teaching the child about Vishnu-bhakti. But when it was proved that they were innocent, he decided to kill the child.
Hiranyakashipu tortures his son: The order carriers of the demoniac king tried to kill the child by striking him with deadly weapons, putting him under the feet of elephants, subjecting him to hellish conditions, throwing him from the peak of a mountain, etc., but they could not kill him. Hiranyakashipu became more and more agitated. He challenged Prahlada, “Where is your God?” and Prahlada replied that God resided everywhere. Pointing to one of the pillars in the palace Hiranyakashipu asked: “Is your God within this pillar?” and the child answered “Yes. He is.” At once he forcefully struck the pillar and shattered it into pieces. From inside the pillar, the Supreme Lord Hari, appeared as Narasimha (the half-man half-lion incarnation).
Narasimhadeva, the protector of devotees: He was neither in the form of a human nor an animal. He used His nails as weapons and killed the demon during the twilight period (neither day nor night) sitting on the threshold of the palace (neither inside nor outside) by keeping him on His own lap. Thus the Supreme Lord killed the demon and protected His devotee without violating any of the benedictions awarded by Lord Brahma.