POMFRET, Conn. — A teacher has been fired from a private school in Massachusetts over allegations he had an inappropriate sexual relationship with one of his students at the Connecticut boarding school where he taught previously, school officials said Tuesday.

The teacher, John Becker, was accused of having the relationship with a student at Connecticut’s Pomfret School, where he taught for four years through last spring.

The Northfield Mount Hermon school, where Becker began teaching in the fall, said in a letter to the school community that Becker was fired Friday after it learned of the allegations. School head Peter Fayroian said that Becker denied having a sexual relationship with the girl but that its investigation found he had crossed boundaries.

The head of the Pomfret School, J. Timothy Richards, said it had no information about such a relationship before he learned of the allegation from the Massachusetts school. The school has hired an outside investigator, he said. Connecticut state police are also investigating.

Becker did not respond to a phone message seeking comment.

The Pomfret School disclosed in 2016 that an independent investigation had found four teachers likely engaged in sexual misconduct as far back as the early 1970s. In response, the school stepped up teacher training on sexual harassment.

“This news is particularly shocking to me given the amount of attention that Pomfret has directed over the past few years to teacher training around sexual harassment and maintaining appropriate boundaries,” Richards said in a letter to the school community. “Like all employees, Mr. Becker participated in this training, which makes this matter all the more troubling.”

A background check Northfield Mount Hermon did before hiring Becker did not turn up any related issues, Fayroian said, and the school is currently speaking with students who were connected with Becker in case any boundaries were crossed with them.