SALEM, Mass. -- 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 -- a possibility of freedom that drew angry criticism from the victim's parents.

The 2013 slaying of Danvers High School teacher Colleen Ritzer by Philip Chism in Massachusetts was "brutal and senseless," Salem Superior Court Judge David Lowy said as he pronounced the sentence.

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

Chism was 14 when he followed Ritzer, who was 24, into a school bathroom, strangled her, stabbed her at least 16 times and raped her. His lawyers acknowledged he killed her but argued he was mentally ill, a contention rejected by the jury.

He will serve life in prison with the possibility of parole in 25 years on a murder charge, but he received 40-year concurrent sentences on rape and robbery charges. The net result will leave him eligible to be paroled in 40 years, when he would be in his 50s.

Ritzer's parents said Chism should never have a chance to leave prison on parole.

Her mother, Peggy Ritzer, called the sentence unacceptable. She blamed the state Supreme Judicial Court, which ruled in December 2013 that juveniles could not be sentenced to life in prison without the possibility of parole.

Prosecutors had asked that Chism 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.

During the earlier sentencing hearing, Ritzer's parents, siblings, colleagues and lifelong friends on Friday described a young woman who loved her job, her students and her 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 to be happy is so difficult," she said. "He is pure evil, and evil can never be rehabilitated."

Tom Ritzer said he felt as though he had failed his daughter.

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

Chism's mother, Diane Chism, cried quietly as he was sentenced. Earlier Friday, she released a statement 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 said Chism 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 was 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 he put her body. He also was convicted of armed robbery for stealing Ritzer's credit cards and underwear.