The story of Narasimha as described in the Bhagavata Purana is as follows:
In his previous avatara of Varaha, Vishnu killed a rakshasa known as Hiranyaksha. Hiranyaksha’s brother Hiranyakashipu, greatly angered by this, started to abhor Vishnu and his followers. He decides to attempt to kill Vishnu by gaining mystical powers, which he believes Brahma, the chief among the devas, will award him if he undergoes many years of great austerity and penance. This initially seems to work as planned with Brahma becoming pleased by Hiranyakashipu’s austerities. Brahma thus appears before Hiranyakashipu and offers him a boon that he will personally make true anything he wishes for. In reply, Hiranyakashipu pleads himself to be made immortal. He said he did not want to die.
“O Brahma, give me victory over death” he said. Brahma replied it is not possible. But he could bind his death with certain conditions. To this Hiranyakashipu requested Brahma as follows:
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 about by any weapon, nor by any human being or animal. Grant me that I not meet death from any entity, living or nonliving created by you. 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. Brahma said, “Tatha asthu” (be it so) and vanished. Hiranyakashipu was happy thinking that he had won over death.
One day while Hiranyakashipu is performing austerities at Mandaracala Mountain, his home is attacked by Indra and the other devatas. At this point the divine sage Narada intervenes to protect Kayadu, whom he describes as ‘sinless’. Following this event, Narada takes Kayadu into his care and while under the guidance of Narada, her unborn child (Hiranyakashipu’s son) Prahlada, becomes affected by the transcendental instructions of the sage even at such a young stage of development. Thus, Prahlada later begins to show symptoms of this earlier training by Narada, gradually becoming recognised as a devoted follower of Vishnu, much to his father’s disappointment.
Hiranyakashipu eventually becomes so angry and upset at his son’s devotion to Vishnu (whom he sees as his mortal enemy) that he decides he must kill him, but each time he attempts to kill the boy, Prahlada is protected by Vishnu’s mystical power. When asked, Prahlada refuses to acknowledge his father as the supreme lord of the universe and claims that Vishnu is all-pervading and omnipresent.
Hiranyakashipu points to a nearby pillar and asks if ‘his Vishnu’ is in it:
“O most unfortunate Prahlada, you have always described a supreme being other than me, a supreme being who is above everything, who is the controller of everyone, and who is all-pervading. But where is He? If He is everywhere, then why is He not present before me in this pillar?”
Prahlada then answers, He was, He is and He will be. In an alternate version of the story, Prahlada answers, He is in pillars, and he is in the smallest twig.
Hiranyakashipu, unable to control his anger, smashes the pillar with his mace, and following a tumultuous sound, Vishnu in the form of Narasimha appears from it and moves to attack Hiranyakashipu. in defence of Prahlada. In order to kill Hiranyakashipu and not upset the boon given by Brahma, the form of Narasimha is chosen. Hiranyakashipu can not be killed by human, deva or animal. Narasimha is neither one of these as he is a form of Vishnu incarnate as a part-human, part-animal. He comes upon Hiranyakashipu at twilight (when it is neither day nor night) on the threshold of a courtyard (neither indoors nor out), and puts the demon on his thighs (neither earth nor space). Using his sharp fingernails (neither animate nor inanimate) as weapons, he disembowels and kills the demon.
Kurma Purana describes the preceding battle between the Purusha and demonic forces in which he escapes a powerful weapon called Pashupata and it describes how Prahlada’s brothers headed by Anuhrada and thousands of other demons “were led to the valley of death (yamalayam) by the lion produced from the body of man-lion” avatara. The same episode occurs in the Matshya Purana 179, several chapters after its version of the Narasimha advent.
The Bhagavata Purana further narrates: even after killing Hiranyakashipu, none of the present demigods are able to calm Narasimha’s fury, not even Shiva. So all the gods and goddesses call his consort, Lakshmi, but she is also unable to do so. Then, at the request of Brahma, Prahlada is presented to Narasimha, and finally he is calmed by the prayers of his devotee. Before parting, Narasimha rewards the wise Prahlada by crowning him as the king.