An Edgecomb man who worked as a substitute teacher at Medomak Valley High School in Waldoboro was arrested Friday on charges including sexual exploitation of a minor, for an alleged incident involving a student.

Charges against William Bourget, 52, stem from an investigation by Lincoln County Sheriff’s Office and Waldoboro police into a report Bourget was in an online relationship with a student at the high school. Police allege he exchanged sexually explicit photographs with the student, according to a news release from Lincoln County Sheriff’s Office. Police said the incident came to light when the student told a friend about it, and the friend reported it to school officials.

Bourget was arrested Friday night at his Edgecomb home and charged with sexual exploitation of a minor, class B, and possession of sexually explicit material, class D.

Bourget was taken to Two Bridges Regional Jail in Wiscasset, where he is being held in lieu of $5,000 cash bail.

The sheriff’s office asks anyone with information about the incident to contact Detective Jared Mitkus at 882-7332.