MARTINEZ (CBS SF) — A former teacher at a Walnut Creek middle school pleaded guilty Thursday to molesting multiple children under the age of 13, Contra Costa County prosecutors said.

Michael Bartel, 34, of Martinez, entered the guilty plea to four counts of child molestation and Judge Patricia Scanlon sentenced him to 25 years to life in prison.

READ MORE: South Bay Congressman Welcomes Afghan Refugees Arriving in Fremont

Michael Bartel booking photo (Walnut Creek Police Department)

Bartel, a former science teacher at Walnut Creek Intermediate School at 2425 Walnut Blvd., admitted to engaging in lewd and lascivious conduct with children between May 14, 2016, and Nov. 3, 2017, according to the district attorney’s office.

The case came to the attention of authorities in late October 2017 when someone from the East Coast called Martinez police to report someone believed to be Bartel had said in an online forum that he engaged in hands-on sexual activity with minors, prosecutors said.

READ MORE: 4.3 Magnitude Earthquake Strikes Near Los Angeles

An undercover police officer eventually contacted Bartel on the same online forum, and Bartel agreed to meet the officer in anticipation of going somewhere in the county to have sex with a minor, prosecutors said.

On Nov. 3, Bartel arrived at the agreed-upon location and was arrested. Investigators found child pornography on his cellphone and that he had distributed the images.

Authorities determined the victims were not any of Bartel’s current or former students. Prosecutors did not indicate who the victims were or what their connection was to Bartel.

MORE NEWS: San Francisco Mayor Defends Criticism After Video Catches Her Dancing Maskless at Night Club

© Copyright 2018 CBS Broadcasting Inc. and Bay City News Service. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.