Kālikā purāṇa narrates an interesting tale about the origin and death of Narakāsura.
The avatāra of Viṣṇu as ādivarāha occurred for the sake of destruction of an asura named Hiraṇyākṣa. Assuming a female form, Bhūdēvī bore within herself the vīrya of Varāha. However, as this occurred when Bhūdēvī was rajasvalā, her womb conceived a child that was filled with negative and violent qualities. Filled with immense lust for Bhūdēvī, Varāha ignored the counsel of Paramaśiva and continued his sport with Bhūdēvī, who now assumed the form of a female boar. Due to their countenance, three children were born: Suvr̥tta, Kanaka, and Ghora. Varāha, along with his family, began to wildly roam through the earth, causing great distress not only to various forms of life but also to ādiśēṣa who carries the weight of the entire earth. Due to lust for his wife and blind affection towards his children, Varāha forgot his true self and caused great distress to all the worlds.
Various sages and dēvatās, led by Brahmā and Shiva, sought refuge at the lotus feet of Nārāyaṇa, who was ever-present in Vaikuṇṭha in his original form. Mahāviṣṇu addressed them thus: “My incarnation as Varāha should have ended right after the killing of the demon. Now, due to intercourse with a rajasvalā and due to brahmahatyā dōṣa, the body of Varāha has become sinful. I will slowly begin to withdraw my energy from this form. Lord Shiva can end this form at the right time”.
Having said so, Viṣṇu withdrew his energy from Varāhamūrti making him weak and feeble. At the same time, Mahādēva absorbed within himself the collective energy of Brahmā and the rest of the celestials, assuming the form of Mahāśarabha. This great beast entered into a fierce battle with Varāha and his sons, which lasted for a thousand years. Due to intense attack by Sharabha, Varāha sought help from Nr̥simha who appeared to assist his friend and began a fierce attack on Sharabharūpī Rudra. Distraught by this combined attack, Sharabha raised his hand in prayer to Nārāyaṇa, who immediately granted immense strength to Sharabha, making him more powerful than both of his other incarnations, Varāha and Narasimha. Rejuvenated by this new strength, Sharabha made a loud noise thereby creating millions of terrifying śivagaṇas. Together with his gaṇas, Sharabha subdued Vārāha and his army, eventually resulting in ādivarāha realizing his true form as Nārāyaṇa. He requested Sharabha to kill him by slicing him into two halves, from which two sages named Nara and Nārāyaṇa were born. From his three sons who were also killed, three fires (āhavanīya, dakṣiṇāgni, gārhapatya) arose.
Thus, the incarnation of ādivarāha ended. In the future, after several kalpas, Varāha again incarnated to assist Bhūdēvī who was sinking due to excess population, assuming the form of Ekaśr̥ṅga Varāha this time. A similar story repeated again, but the body of Varāha was destroyed this time by the mighty Subrahmaṇya. That is an entirely different tale.
After the death of ādivarāha, Nārāyaṇa sliced his remaining body parts to create various forms of Yajñas such as jyōtiṣṭōma, agniṣṭōma, vrātyaṣṭōma, paunarbhavaṣṭōma, vr̥ddhaṣṭōma, br̥hatṣṭōma, atirātra, vairāja, aśvamēdha, naramēdha, mahāmēdha, rājasūya, vājapēya, sāvitrī, rākṣasasatra, sarpayāga, gōmēdha, vr̥kṣayāga, māyēṣṭi, paramēṣṭi, r̥cōtkarṣa, pañcamārgātiyōjana, liṅgasaṁsthānayōga etc.
After the death of Varāha, Mahādēva ended his Sharabhāvatāra by withdrawing his energy from the beast. From the eight feet of Sharabha, aṣṭamūrtis arose, representing the sky, sun, moon, fire, earth, water, air and hotr̥. The remaining central limb of Sharabha, holding a kapāla, assumed the ferocious form of Kapāla Bhairava, whose followers came to be known as the Kāpālikas. With eight hands and surrounded by śaktis such as Kālī and Chaṇḍī, this wish-fulfilling form of the Lord appeared on chaitra śuddha caturdaśī.
Though Varāha and his sons had now perished, Bhūdēvī still bore her rajasvalā garbha. She gave birth to a powerful son after bearing the garba for thousands of years. She left the baby, named Naraka, in the care of king Janaka. Janaka remembered the grace of Bhūdēvī who had granted him a daughter named Sītā in the past yuga and took care of the baby as his own. Unable to stay separated from her child, Bhūdēvī assumed the form of a nanny named Kātyāyanī and entered the palace of Janaka to take care of the baby.
When Naraka came of age, Bhūdēvī and Varāha revealed themselves as his true parents and made him the king of Prāgjyōtiṣa. Viṣṇu taught his son Naraka the upāsanā of Yogamāyā, who was present in Kāmarūpa as Bhagavatī Kāmākhyā; and warned him that if he worshiped any deity other than Kāmākhyā, that would lead to his death.
After several years, due to siddhis awarded by Kāmākhyā, Naraka became arrogant and abandoned the path of Dharma. At that time, Brahmarṣi Vasiṣṭha arrived in Nīlakūṭa to worship Devī Kāmākhyā. However, overcome with arrogance, he insulted the sage and did not allow him to have the darśana of the Goddess. Extremely angry, the great sage cursed him thus:
“O Naraka, you were born of Viṣṇu, now you will die at his hands as well. I will come back here to worship the Mother only after you fall dead. Till that time, O Mother, please leave this sinful city ruled by this asura”. As requested by her devotee Vasiṣṭha, Kāmākhyā disappeared from Kāmarūpa along with her yōnimaṇḍala and retinue of deities. Without the grace of the great Goddess, Naraka no longer remained invincible.
After the departure of Paramēśvarī, Brāhmaṇas left the city and the city was devoid of Yajñas and auspicious activities. Distraught and weak, Naraka sought counsel from his friend Bāṇāsura. As advised by him, Naraka performed severe penance to obtain a boon from Brahmā. As a result of the boon, Naraka became invincible again and began to terrorize the worlds.
Eventually, Lord Kr̥ṣṇa along with his wife Satyabhāmā came to prāgjyōtiṣapura to slay Naraka. As Mukunda delivered the deathblow to Naraka through his sudarśana, dying Naraka saw the form of Kāmākhyā behind Kr̥ṣṇa, in the form of Mahākālī:
sa yudhyat kr̥ṣṇanikaṭē kālikāṁ kālikōpamām |
raktāsyanayanāṁ dīrghāṁ khaḍgaśaktidharāṁ tadā ||
apaśyajjagatāṁ dhātrīṁ kāmākhyāmapi mōhinīm |
sa vismitastadā bhītastāṁ dr̥ṣṭvā jagatāṁ prasūm ||
Having realized that Kr̥ṣṇa had the blessings of the great Goddess, Naraka sought refuge at his lotus feet and accepted death. As per her promise to Vasiṣṭha, Goddess Kāmākhyā returned to Kāmarūpa pīṭha along with her retinue of shaktis once again to accept the worship of Brahmā, Viṣṇu, Rudra and other celestials.