Updated

A teenager who raped and killed his high school math teacher was sentenced Friday to life in prison with eligibility for parole in 40 years.

Philip Chism was convicted in December in the 2013 death of Danvers High School teacher Colleen Ritzer. He was 14 when he followed the 24-year-old Ritzer into a school bathroom, strangled her, stabbed her at least 16 times and raped her.

Judge David Lowy pronounced the sentence after hearing victim-impact statements from Ritzer's loved ones. He called the slaying "brutal and senseless."

"Colleen Ritzer lived a life of quiet heroism," Lowy said. "The crashing waves of this tragedy will never wane."

Ritzer's parents, siblings, colleagues and lifelong friends described a young woman who loved her job, her students and life and who never had a negative word to say. Many of them wore pink, her favorite color.

Peggie Ritzer said her daughter's death had left her "so very broken."

"Now I isolate myself from people I love because pretending being to be happy is so difficult," she said.

She asked the judge to impose the maximum sentence. "He is pure evil, and evil can never be rehabilitated," she said.

Tom Ritzer said he felt like he had failed his daughter.

"I didn't protect Colleen. A dad's job is to fix things. I would do anything I could if could fix this for Colleen."

Prosecutors had asked that he stay in prison for at least 50 years. Defense attorney Susan Oker asked for a sentence that would make Chism eligible for parole no later than age 40. She cited scientific studies that said a juvenile brain is not fully developed.

Chism's mother, Diane, released a statement Friday expressing her condolences to Ritzer's family.

"Words can't express the amount of pain and sorrow these past 2 1/2 years have been," she said. "However, there is no one who has suffered more than the Ritzer family. My utmost esteem, prayers and humble respect is with them today as they continue their journey to heal."

At trial, the defense admitted Chism killed Ritzer but said he was suffering from severe mental illness and wasn't criminally responsible for his actions. A psychiatrist who testified for the defense said Chism, who had just moved to Massachusetts from Clarksville, Tennessee, was hearing voices and in the throes of a psychotic episode when he killed Ritzer.

Chism was convicted of raping Ritzer inside the bathroom but was acquitted of a second rape, committed with a tree branch in woods near the school where Chism put her body. He was also convicted of armed robbery for stealing Ritzer's credit cards and her underwear.