A Matawan-Aberdeen Regional High School substitute teacher faces child-endangerment charges, accused of carrying on sexually-explicit talks with two teens in the school.

Philip Riveley (Monmouth County Prosecutor's Office)

Philip Riveley, 29, of Woodbridge, was arrested Thursday, according to information from the office of acting Monmouth County Prosecutor Chris Grammiccioni.

He's accused of engaging two girls, age 15 and 17, in the conversations. Authorities lodged one charge in connection with each of the teens. Investigators did not disclose how they were alerted to the situation.

Riveley was placed in the Monmouth County Correctional Institution in Freehold, with bail set at $150,000 cash.

The charges of endangering the welfare of a child are second-degree, each carrying a possible sentence of five to 10 years on conviction.

The case is still being pursued by Monmouth County Detective Andrea Tozzi, who can be reached at 800-533-7443, and by Matawan Police Detective Joseph Lovallo at 732-566-1010.