Danvers teen, Philip Chism, was accused of murdering his teacher after her body was found outside the high school.
Colleen Ritzer, 24, was found dead behind the school, officials said.
Ritzer, 24, of Andover, taught math at the school.
Essex District Attorney Jonathan Blodgett released few details about the murder, but said blood was found in a second-floor bathroom at the high school shortly after 11 p.m. Tuesday night.
The school was immediately secured.
Sometime on their last day at the school together Tuesday, prosecutors say, teacher Colleen Ritzer and 14-year-old student Philip Chism crossed paths, and he killed her.
Officials haven't released a cause of death or discussed a motive in the killing. A court filing said Ritzer and Chism knew each other from the high school, but it didn't elaborate.
Investigators said in court documents that the arrest was made based on statements by the suspect, evidence from school surveillance cameras and corroborating evidence in multiple places.
Ritzer was "a very respected and loved teacher," Blodgett said.
She was in her second year teaching at the school, according to our news partners at Wicked Local/Danvers, and she previously taught at the Hale Middle School in Stow.
All public schools in Danvers were closed Wednesday as police investigate the homicide.