A 14-year-old Danvers High School freshman ducked into a darkened movie theater for a matinee of the new Woody Allen movie after authorities say he murdered his popular math teacher and dumped her body in the woods, a law-enforcement source said.

Authorities did not say specifically when they believe Philip D. Chism “assaulted and subsequently murdered” 24-year-old Colleen Ritzer. But the source said it was before he bought a ticket to the 4:30 p.m. Tuesday screening of “Blue Jasmine” at the Hollywood Hits theater in Danvers. Police reported Chism left the theater about an hour and a half later.

The theater manager said Chism “blended right in.”

“He was here and gone before we even knew he was here,” manager Scott Przybycien told the Herald.

Przybycien said police showed up at the theater Tuesday night and asked about Chism, who at the time was considered only a missing person.

Chism was found at 12:30 a.m. yesterday while walking north on southbound Route 1 near Salem Road in Topsfield — about six miles by foot from the theater.

A law-enforcement source said authorities believe Chism attacked Ritzer with a box cutter. The source said the boy was seen on school security video pushing a large recycling bin, which authorities believe he used to take her body outside.

Chism was charged with Ritzer’s murder after investigators interviewed him and reviewed surveillance video from the school.

Related:

Police found Ritzer’s body near the school, where they went to look for her after family reported her missing at 11:17 p.m. Tuesday. Cops found blood in a second-floor bathroom inside the school.

Ritzer graduated from Andover High School and Assumption College and was in her second year at Danvers High, where she quickly earned a reputation as an enthusiastic and kind-hearted math mentor.

“I hate math … but she made it fun,” said Christian Veatch, 17, recalling an “off day” last year when Ritzer noticed he was upset and pulled him out into the hall. “We ended up talking out in the hall for like 20 minutes. I walked in the class feeling a lot better, more happy. I was ready to do my work. In 20 minutes, she totally changed my attitude. It was amazing.”

Chism, a wide-eyed, 6-foot-2 junior varsity soccer player, was born in Tennessee and moved to Danvers this summer; the neighborhood postman said he believed the family moved there in late May or early June.

Danvers High freshman Andrew Poland, 14, said he was stunned by the accusations against his classmate.

“He’s a really quiet kid. It’s insane. I’m completely shocked,” Poland said. “I didn’t think Philip would be the kind of person to do this. … I don’t know what happened.”

Chism pleaded not guilty to murder yesterday in Salem District Court, where prosecutors are charging him as an adult. He was held without bail, and an expert will evaluate him to determine whether he is legally competent.

Several people, including Chism’s mother, attended the seven-minute court hearing but did not speak to reporters afterward.

Chism’s arrest marked a horrifying turn of events for Danvers High School staff and students. They’d gone to bed Tuesday night worried about Chism after the missing-person alert was put out, only to awake yesterday and find he was accused of killing the beloved teacher.

“It was like, hashtag find Phil, and then everyone just turned,” said Veatch, referring to the social-media effort to locate Chism Tuesday night. “Now everyone’s saying, ‘I can’t believe I talked to a murderer.’ ”

About 300 people attended a vigil for Ritzer at the school last night. Danvers mom Janine Nash sold ribbons in Ritzer’s memory, with proceeds to go to the teacher’s family.

“I had about 15 kids putting them together in my house today,” Nash said. “They all felt terrible and wanted to do something about it.”