A Massachusetts teenager charged with killing his teacher last year after following her into a bathroom similarly followed a worker at a youth detention facility into a locker room last month before choking and beating her, prosecutors said Wednesday.

Philip Chism, 15, made sure he wasn't being watched, took off his footwear to muffle his footsteps, then crouched down as he made his way along a corridor before following the 29-year-old woman into the locker room at Metro Youth Services facility in Boston on June 2, prosecutor Mark Zanini told a judge in Boston Juvenile Court.

Chism, with a pencil in his hand, pushed the woman against the wall in the bathroom, choked her, and then hit her in the head with his fists, he said.

"The victim was trying to scream but it was ineffective because her airway was closed by virtue of the defendant's strangling her," Zanini said.

After getting Chism's hand off her neck, she screamed and other facility workers pulled Chism away from her, Zanini said.

She suffered injuries to her face, jaw, neck and back, and got a hole in the back of her shirt that was the same size as a pencil, which was found on the floor, Zanini said.

Chism was being held at the facility without bail after pleading not guilty to killing Danvers High School math teacher Colleen Ritzer in October. Chism, who was 14 at the time, had recently moved to Danvers from Clarksville, Tennessee. He has since been moved to a different detention facility.

He was ordered held on $250,000 bail in the attack on the youth worker on charges of attempted murder by strangulation, assault with intent to murder, kidnapping, and two counts of assault and battery with a dangerous weapon.

The handcuffed Chism hung his head throughout the proceeding and did not speak other than to say "yes" when the judge asked him if he understood that he was not allowed to have any contact with the worker or any witnesses in the case. He didn't enter a plea. His mother was also in court.

Chism is being charged as a youthful offender in the Boston case, meaning the proceedings in juvenile court are open and expose him to potential adult penalties.

Chism's attorney, Denise Regan, did not challenge the bail or conditions of bail. She asked that her client be excused from his next scheduled court appearance on Sept. 19 because of the stress it causes him.