Ashwatthama was the son of Guru Dronacharya and Kripi. He was born with a gem on his forehead which gives him power over all living beings lower than humans, it protects him from hunger, thirst and fatigue. Since Hastinapur ruled by Dhritrashtra offered Drona the privilege of teaching the Kaurava princes both Drona and Ashwathama were loyal to the Kauravas in the Kurukshetra war.
In the war, Dronacharya was killed by Dhristadumnya when he dropped all his weapons. Krishna knew that it was not possible to defeat armed Dronacharya so he suggested Yudhishthira to convince Drona about his son’s death, which would make him vulnerable. After learning of the deceptive way his father was killed Ashwatthama becomes filled with wrath and vows to kill each of the Pandavas. After Duryodhana was struck down by Bhima Ashwatthama rushes to him and swears to take revenge on the Pandavas and Duryodhana appoints him as the commander-in-chief of the Kaurava army. Furious with the Pandavas deception, Ashwatthama plans to attack the Pandava camp at night along with Kripacharya and Kritavarma. Inside the camp Ashwatthama first kicks and awakens Dhristadumnya, the killer of his father. Ashwatthama then strangles the half awake Dhristadumnya by choking him to death. Ashwatthama proceeds by killing all the remaining warriors of the Pandava army. Even as some soldiers try to fight back Ashwatthama remains unharmed. Those who tried to flee from Ashwatthama’s wrath are killed by Kripacharya and Kritavarma outside the camp.
The Pandavas and Krishna who were away during the night return back to the camp the next morning. Hearing the news of these events Yudhishthira faints and the Pandavas become inconsolable. Bhima angrily rushes to kill Ashwatthama. The triggered Ashwatthama invokes the Brahmastra against the Pandavas to fulfill the oath of killing them. Krishna asks Arjuna to fire the Brahmashira, the anti missile against Ashwatthama’s Brahmashtra to save themselves. Vyasa steps in and prevents the weapons from clashing against each other. He asks both Arjuna and Ashwatthama to call back their weapons. Arjuna knowing how to do it, calls his weapon back. Ashwathamma, however not knowing the process to call back the Brahmastra instead directs it towards the womb of the pregnant Uttara in an attempt to end the lineage of the Pandavas. However Krishna saves Uttara’s unborn child from the effects of Brahmastra. As the child faced a test of life even before taking birth, Lord Krishna names him Parikshit and later on the child succeeds Yudhishthira to become the king of Hastinapur.
Ashwatthama was made to surrender the gem on his forehead and was cursed by Krishna of immortality. He would roam in the forests with blood and puss oozing out of his wounds and cry for death but death would not meet him. He would remain alive till the earth exists, witnessing the destruction of mankind. Since that day Ashwatthama is believed to be roaming in the forests crying for salvation.