Janamejaya (Sanskrit: जनमेजय) was a Kuru king who reigned during the Middle Vedic period (12th-9th centuries BCE). Along with his father and predecessor Parikshit, he played a decisive role in the consolidation of the Kuru state, the arrangement of Vedic hymns into collections, and the development of the orthodox srauta ritual, transforming the Kuru realm into the dominant political and cultural part of northern India. He also appears as a figure in later legends and traditions, the Mahabharata and the Puranas.
Janamejaya is mentioned as a great king and conqueror in a number of late Vedic texts. The Aitareya Brahmana (VIII.21) states that his priest Tura Kāvasheya anointed him with the Aindra Mahabhisheka (great anointing of Indra). The Shatapatha Brahmana mentions that he performed an ashvamedha (horse sacrifice), for getting himself rid of the Brahmahatya (sin associated with killing of a Brahmin), and the priest who performed it for him was Indrota Daivapa Shaunaka at a place named Āsandīvat.
Only one Janamejaya is mentioned in Vedic literature; however, post-Vedic literature (Mahabharata and Puranas) seems to indicate the existence of two kings by this name, one who lived before the Kurukshetra War was an ancestor to the Pandavas, and one who lived later and was a descendant. Historian H. C. Raychaudhuri believes that the second Janamejaya's description better corresponds to the Vedic king, whereas the information available about first is scanty and inconsistent, but Raychaudhuri questions whether there were actually two distinct kings. He suggests that there "is an intrusion into the genealogical texts" of the late, post-Vedic tradition, which also has two of Janamejaya's father Parikshit, possibly "invented by genealogists to account for anachronisms" in the later parts of the Mahabharata, as "a bardic duplication of the same original individual regarding whose exact place in the Kuru genealogy no unanimous tradition had survived."[note 1]
He was the son of King Parikshit and Queen Madravati according to the Mahabharata (I.95.85).  He was the grandson of great warrior Abhimanyu and the great-grandson of Arjuna, the valiant warrior hero of the Mahābhārata. He ascended to the Kuru throne following the death of his father. His significance comes as the listener of the first narration of the Mahābhārata, narrated by Vaishampayana, pupil of Vyasa. According to the Vayu Purana and the Matsya Purana, there was a dispute between him and Vaishampayana. Possibly, as its aftermath, he abdicated and his son Shatanika succeeded him.
In Mahabharata, Janamejaya was mentioned as having six able brothers viz, Kakshasena, Ugrasena, Chitrasena, Indrasena, Sushena and Nakhaysena. The initial chapters of the epic narrates various aspects of his life including his conquest of Takshasila and about his encounter with Nāga Takshaka. He wanted to exterminate the race of Nagas, since Takshaka was responsible for the death of his father Parikshit.
Emperor Janamejaya was responsible for the retelling of the famous epic Mahābhārata, a story of Janamejaya's ancestors from the time of Bharata up to the great Kurukshetra war between his great-grandfathers the Pandavas and their paternal cousins the Kauravas. The Mahabharata states that it was recited to Janamejaya at the sarpa satra (snake sacrifice) by the sage Vaishampayana to whom it had been imparted by his perceptor Vedavyasa, after he asked Vaishampayana about his ancestors.
Emperor Janamejaya ascended to the throne of Hastinapura upon the death of his father Parikshit. According to legend, Parikshit, the lone descendant of the House of Pandu, had died of snakebite. He had been cursed by a sage to die so, the curse having been consummated by the serpent-chieftain Takshak. Janamejaya bore a deep grudge against the serpents for this act, and thus decided to wipe them out altogether. He attempted this by performing a great Sarpa satra – a sacrifice that would destroy all living serpents. At that time, a learned sage named Astika, a boy in age, came and interfered. His mother Manasa was a Naga and his father a Brahmin. Janamejaya had to listen to the words of the learned Astika and set the then-imprisoned Takshaka free. He also stopped the massacre of the Nagas and ended all enmity with them (1,56). From that time onward, the Nagas and Kurus lived in peace. The mass sacrifice was started on the banks of the river Arind at Bardan, now Known as Parham, a corrupt form of Parikshitgarh. A masonry tank (reservoir) said to have been built by Emperor Janamejaya to mark the site of the sacrificial pit, known as Parikshit kund, still exists in Mainpuri district. This is known as Gowdvana. Close to this village a very large and high khera[further explanation needed] containing the ruins of a fort and some stone sculptures has been found. It is said to date back to the time of Emperor Parikshit. A popular local legend is that as a consequence of the virtues of that sacrifice snakes are still harmless in this place and its neighborhood.