Defense attorney Denise Regan acknowledged to the Essex Superior Court jury that her client, Philip Chism, on October 22, 2013 killed Colleen Ritzer, 24, but she said it was because of a “psychosis,” the Boston Globe reported.

The mental illness that made Chism, then 14, hallucinate, hear voices and suffer from depression and anxiety went untreated until after he was in custody for killing Ritzer, Regan said.

Ritzer was raped, strangled, cut and slashed 16 times with a box cutter and was later sexually assaulted with a tree branch, officials have said.

“It’s going to be really hard to listen to this. It’s going to be challenging and heartbreaking. But the real work of this is to figure out the terrible landscape of a young boy’s mind in the months and days and weeks before this terrible event,” Regan said to the 10 men and seven women of the jury who promised to keep an open mind, the Globe wrote.

Chism was able to hide his mental illness from his parents and other adults while he lived in his native Tennessee, spending much time with the family of his close friend, Regan said.

That support system crumbled when he moved with his mother to Danvers after his parents divorced, and the latent anger he carried was triggered when Ritzer asked about his former home, she said.

The defense is expected to call psychiatrist Dr. Richard Dudley Jr. to testify about Chism’s mental state at the time of the attacks. He is expected to tell jurors the teen is not criminally responsible for killing Ritzer, the Globe reported.

But Essex County District Attorney Kate MacDougall reportedly said that Chism deliberately acted when he raped and murdered his teacher, who was giving Chism extra math help before he killed her.

“The defendant strangled Colleen. The defendant used a box cutter he had to cut or slice her throat… He spent 30 minutes in the woods discarding evidence, doing what he wanted, and ultimately discarding Colleen,” MacDougall said, the Globe wrote.

Prosecutors have said in court papers that Chism came to school that day with a knife, a box cutter, a change of clothes and a ski mask.