A Middletown High School math teacher has been arrested and accused of trying to meet with a 15-year-old girl in New York City. 

State police say Jonathan Castell thought he was communicating with a teenage girl via text and social media, but he was actually talking to authorities who work to catch child predators. 

Castell was arrested yesterday and charged with endangering the welfare of a child. He was issued an appearance ticket and is due back in court Thursday at noon. 

On the City of Middletown school district's website, the school superintendent says the district is "working closely with law enforcement agencies and remains steadfast in holding the safety and security of our entire school community as paramount."