Jeffrey Yao, 23, was held without bail after not guilty pleas to charges including murder were entered on his behalf at his arraignment in Woburn District Court.
Yao approached Deane Stryker, 22, from behind and stabbed her 20 times with a 10-inch hunting knife at the Winchester Public Library on Saturday morning, prosecutor Kate Cimini said. Stryker was taken to a hospital where she was pronounced dead.
"This was a vicious unprovoked attack with a knife on a young woman in a public place," she said in court, adding that Yao had had several run-ins with law enforcement in the past.
A 77-year-old man who came to Stryker's aid was cut on the arm and was treated and released from the hospital, Cimini said.
"Jeff has a long history of mental illness, including multiple hospitalizations," Yao's attorney, J.W. Carney Jr., told The Boston Globe. "This terrible tragedy, which shocked his parents, is unquestionably related to his severe mental illness."
Yao sat calm and emotionless in court and did not say anything.
Carney said outside court that he will have doctors examine Yao and may pursue an insanity defense.
Yao and Stryker attended Winchester High School at the same time, but Carney said they did not know each other. The motive for the attack remains under investigation.
Stryker was a first-year student at the University of New England's College of Osteopathic Medicine who hoped to become a doctor, college President James Herbert said on Facebook.
"I was shocked and saddened to learn of the death of one of our students, Deane "Kenny" Stryker, who was killed on Saturday," he said.
Stryker was an advocate for domestic violence and mental health awareness, served as an orientation leader and was part of a student organization that provides confidential peer support to students at the Portland, Maine, school who need a place to turn when they are struggling, he said.
Yao's next court date is April 11.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.