TARBORO, N.C. (WNCN) — One man who’s a sex offender, was taken to the Edgecombe County Detention Center after being on school property, Edgecombe County Sheriff’s Office said.

According to the sheriff’s office, on Thursday the Edgecombe County Public Schools contacted the Edgecombe County Sheriff’s Office about Michael E. Farmer, who’s a sex offender, being on Martin Millennium Academy Campus.

Farmer was at the school working for a subcontractor, the sheriff’s office said.

Get crime updates in your inbox – Sign up for CBS 17’s Crime Tracker newsletter

With the system in place at the school, every person must check in when they come to the campus. The system in place to catch a sex offender on school grounds worked perfectly, the sheriff’s office said.

The sheriff’s office sex offender unit responded immediately and took Farmer into custody.

Farmer was charged with a sex offender on school grounds and placed in the Edgecombe County Detention Center.