Philip D. Chism allegedly became upset at Danvers High School teacher Colleen Ritzer when she started talking about Tennessee, the state the teenager had recently moved away from after his parents’ “stressful’’ divorce there, according to a police affidavit unsealed today.

Chism, 14, also allegedly left behind a note after raping and murdering Ritzer, a popular math teacher at the North Shore school, last month.

“I hate you all,’’ said the handwritten, folded note, which was found near Ritzer’s body in the woods near the school, according to the affidavit.

Advertisement - Continue Reading Below

According to authorities, Ritzer was attacked in a second-floor bathroom at the school. When her body was found in the woods, her throat cut, police discovered that her attacker had “sexually staged” her body and partially removed her clothing. Evidence of a sexual assault was found on the body, according to the affidavit by State Police Trooper Robert C. LaBarge Jr.

Chism was indicted Thursday by an Essex County grand jury on a charge of first-degree murder as an adult. He also was indicted as a youthful offender on charges of aggravated rape and armed robbery for allegedly using an object in the sexual assault and stealing Ritzer’s credit cards, underwear, and cellphone.

The youthful offender charges will initially be handled in juvenile court, but Blodgett’s office will seek to have all the charges tried in Superior Court.

Chism is due to be arraigned in Essex Superior Court on the murder charge Dec. 4. He is currently being held without bail at a Department of Youth Services facility.

The affidavit by LaBarge also provides a detailed timeline of the movements of Ritzer and Chism, drawn from surveillance cameras in the school building. Ritzer talked with a fellow teacher around 2:30 p.m. She left classroom A209 and then headed to a second-floor bathroom, followed a few moments later by Chism, who entered the bathroom wearing a mask, the cameras indicated.

At 3:06 p.m., a freshman student whose name was redacted from the trooper’s affidavit walked into the bathroom, but quickly left. The student later told police she saw someone’s “butt’’ and assumed that somebody there was changing clothes, prompting the student to leave.

Chism emerges at 3:07 p.m., having spent about 12 minutes inside the bathroom.

Ritzer is never seen again on the surveillance videos.

Over the next several minutes, the cameras showed Chism, who had changed his clothes, returning to the bathroom with a plastic recycling bin, which he then allegedly pushed through the school and out into the adjacent wooded area where it was found about 20 yards away from Ritzer’s body the next day, Oct 23.

According to the affidavit, on Oct. 22, after the end of the school day, another student told police she was in the same classroom with Ritzer and Chism to get some extra help in math.

“She said that at some point, Ms. Ritzer mentioned Tennessee. She said that Philip became visibly upset after she mentioned Tennessee,” Trooper LaBarge wrote. “She said that Ms. Ritzer became aware that Philip was getting upset about her talking about Tennessee. She said that Ms. Ritzer later changed the topic.’’

The student said that after Ritzer stopped mentioning Tennessee, Chism continued to be upset. “She also said that she observed Philip apparently talking to himself in the classroom,’’ the student said.

Following Ritzer’s murder, Diana Chism was interviewed by police about her son. She told them she was living with her aunt, having moved away from Tennessee with her son and her daughter, in part because she was divorcing her husband.

“She said that it was a stressful divorce,’’ the affidavit said.

According to the affidavit, Chism came to school with a “boxcutter, balaclava/ski mask, gloves and multiple changes of clothing,’’ leading investigators to conclude that he planned the attack in advance.

Ritzer was reported missing to Danvers police at about 11:20 p.m. Oct. 22, when she did not return home and did not answer her cellphone.

Police found blood in the second-floor bathroom at the high school, prompting a search of the grounds and the discovery of her body in the woods shortly before 3 a.m. on Oct. 23.

Chism was picked up by police shortly after midnight on Oct. 23, when he was found walking north on Route 1 in nearby Topsfield by Topsfield Police Officer Neil Hovey, who realized he had found the teenager who was the subject of a missing persons report issued earlier by Danvers police.

Hovey searched Chism’s backpack and also frisked him for safety reasons, police said. Chism was carrying a knife, police said. Inside his backpack, Hovey found credit cards, two driver’s licenses, and a pair of women’s underwear, belonging to Ritzer, the affidavit said.

He also found a bloodstained box cutter, police said. Asked where the blood on the box cutter came from, Chism allegedly answered, “The girl.’’

More than 1,000 mourners attended funeral services for Ritzer held at Andover’s St. Augustine Church on Oct. 27. During the service, Ritzer was lauded for seeing “the goodness in other people’’ and as someone who considered teaching not just her job, but her calling in life.