BANGOR, Maine — A former Bangor High School math teacher accused of unlawful sexual contact accepted a deal from the prosecutor and pleaded guilty to assault at the Penobscot Judicial Center on Tuesday.

James McHenry, 48, who was charged in October for allegedly touching the genitals of an underage person, was fined $500 for the misdemeanor assault conviction.

Questioning at a Bangor School Committee meeting held to discuss McHenry’s employment was so upsetting to the male victim that he decided he didn’t want to testify in court, Penobscot County Deputy District Attorney Michael Roberts said Tuesday, explaining why the plea deal was offered to McHenry.

“The victim testified [at a closed-door school board meeting] for an extensive period of time … and as a result of that encounter the victim and his parents said they didn’t want to testify [in court],” Roberts said.

“That was enough,” the prosecutor said.

McHenry was accused of touching the victim’s genitals at an off-school location.

The Bangor School Committee held a special meeting in December, where the victim and others testified, and at the conclusion of the meeting the board fired McHenry.

“He pled guilty to assault and paid a $500 fine and the unlawful sexual contact charge was dismissed,” Roberts said of the plea agreement offered to McHenry.

If convicted of the original unlawful sexual contact charge, also a misdemeanor, McHenry would have faced a penalty of up to a year in jail and a $2,000 fine.

Roberts declined to say if the underage victim was a student or provide any other details about the relationship out of concern that the alleged victim might be identified.

Bangor attorney Jeffrey Silverstein, who is representing McHenry, has said the person who reported the crime was a student at Bangor High School but no longer attends the school. Silverstein also has said his client “denies any sexual component of this.” A message left for Silverstein on Tuesday for comment was not immediately returned.

“I do understand he won’t be teaching anymore,” Roberts said of McHenry. “[The assault conviction] would show up on his record if he did seek employment somewhere else.”