DANVERS, Mass. — Students at the Massachusetts school where a classmate allegedly killed a teacher returned Friday, surrounded by extra safety measures as well as tributes to the victim, including trees adorned with pink ribbons, her favorite color.

Classes resumed at Danvers High School two days after student Philip Chism, 14, was charged with murder in the death of Colleen Ritzer, a 24-year-old math teacher. School had been canceled the previous two days.

On Friday, the U.S. flag outside the school flew at half-staff, and the pink ribbons hung from a row of six trees in front of the building.

The day was stressful and difficult, said freshman Cambria Cloutier, 14.

“Everyone was just kind of crying, crying together. Everyone,” she said.

Outside the school, an electronic sign displayed a tweet that Ritzer posted this summer: “No matter what happens in life, be good to people. Being good to people is a wonderful legacy to leave behind.”

“RIP Miss Ritzer. Gone, not forgotten,” was written in the school colors of blue and white on the windows of a pickup truck in the student parking lot.

A police officer stood outside a cruiser in front of the school, part of the extra security intended to reassure students. Side doors were to be locked for the next few days, and counselors would be on hand, officials told 800 parents at a meeting Thursday night.

About 50 miles away at Assumption College in Worcester, where Ritzer graduated in 2011, a memorial service was held in her honor Friday.

Ritzer’s death left “a mountain of sadness,” said the Rev. Dennis Gallagher, who officiated at the service at the school in Worcester, about 50 miles from Danvers. But, he said, Ritzer was obviously committed to both her profession and to being kind to others.

“Wherever it came from, she seems to have understood some really important things about life,” he said.

Authorities have not said how Ritzer was killed, nor offered clues on Chism’s alleged motive.

Tuesday’s school day ended for both Chism and Ritzer in her last-period Algebra I class, where she noticed him drawing in a notebook rather than taking notes, said Chism’s classmate Rania Rhaddaoui, who sat two seats from him. Ritzer asked Chism to stay after class, Rhaddaoui said, but she didn’t know why.

Ritzer never returned home. Blood in a second-floor school bathroom helped lead investigators to her body in the woods behind the school in this close-knit community north of Boston.

The second-floor bathroom at the school would be closed indefinitely, Danvers police chief Neil Ouellette said.

Authorities believe Ritzer was killed after school ended at about 2 p.m., but they have not released a specific time.

Police picked up Chism early Wednesday, as he walked along Route 1 in neighboring Topsfield. Chism appeared briefly in court Wednesday for arraignment on a murder charge and was ordered held without bail.

Chism had moved to Massachusetts from Tennessee before the start of the school and excelled on the junior varsity soccer team.

Caio Silva, a Danvers High senior and varsity soccer player, said he knew both Chism and Ritzer. He said he and his teammates are helping each other.

“It’s just really sad,” he said. “A lady that was really sweet and a kid who was really sweet. It just doesn’t really match up.”