Aswathama was the son of a angry Brahman called Drona, who was seeking revenge for a humiliation at the hands of his childhood friend, Dhrupad, who was king of Panchal now. Ashwathama's father took to acquiring knowledge of warfare and to making himself powerful. He loved his son, but he loved his disciple Arjuna more, because he spoke in his tongue, he reflected his desires for mastery over warfare.. in short, he was closer to being his reflection than Ashwathama perhaps was. Sun/son..many a father thinks he is the sun, and wants to see his grandeur, reflected in his child, so he can enjoy a greater sense of self. He wants to leave himself in the world, when he passes on.. Ashwathama had to live with the knowledge that Drona saw himself better reflected in Arjuna.
No story turns too simply though. Drona tried little manouveres when he taught the prices, to grant his son more than what he would grant the others. But Arjuna would always out manouvere him: One day Drona sends the princes with pots to fetch water, saying whoever will come back fastest will get some special knowledge. He gave Ashwathama a pot with a wide neck. But Arjun, using his diverse knowledge of water and weapons, managed to return first.
In the battlefield of Kurukshetra, the alignments made Drona supervise the ruthless killing of Arjun's beloved son, Abhimanyu. And Ashwathama.. Drona became a father for the moment when he heard Yudhistira's voice announcing "Ashwatahama is dead'. He faltered, and was killed by Dhishtidhyuma
An enraged Ashwathama swore revenge. He saw how an owl, helpless in the day, was strong against so many crows at night. He did penance and got a boon from Shiva that he would have the strength kill whoever he met that night. He does not manage to kill the Pandavas, who are not in their camp, but instead, unfortunately, kills five children of Draupadi by the Pandavas.
Arjuna and he engaged in combat and Ashwathama invoked the Brahmashira.. as did Arjuna, both weapons a legacy of Drona. The gods try to stop this war, Arjuna managed to revoke his weapon, but the less skilled Ashwathama could not, it had to kill any one person, he aimed it at the womb of Uttara, Abhimanyu's wife. The weapon killed the foetus, but Krishna gave the foetus life again..and cursed Ashwathama to six thousand years of wandering as an unloved leper.
Some say he lives into Kalyuga, some say he comes as typhoons and destructive sea waves.