Only seven warriors survived Ashwatthama's raid on the camp: the five Pandavas themselves, plus two Yadavas, Krishna and Satyaki.
Draupadi wailed over the bodies of her sons, beheaded in the night. Her brother Dhrishtadyumna's charioteer had seen it all. "Ashwatthama did this," he said. "He beheaded the boys."
"I want Ashwatthama's head as vengeance!" Draupadi moaned.
"No," said Krishna. "The killing is over. Capture him alive, and we will subject him to a punishment worse than death. I curse Ashwatthama to live forever, driven from civilization and shunned by all humanity."
Thus Ashwatthama became one of the Chiranjivi, the immortals.
Inspired by: Jaya: An Illustrated Retelling of the Mahabharata by Devdutt Pattanaik.
Notes: This story is on p. 295. There is much more drama about Ashwatthama involving his attack on the survivors with a Brahmastra, and also taking from him the jewel he bore in his forehead, which you can see in this illustration by Gabru Pika at Twitter: