CHICAGO (CBS)–A convicted sex offender was arrested after he was caught on surveillance camera entering a high school in far northwest suburban Woodstock.

James Cornelius, 22, was convicted of criminal sexual abuse of a minor under age 17, according to the Illinois Sex Offender Registry.

Woodstock Police

Cornelius went into Woodstock High School at 4 p.m. on Oct. 1. He stayed for 10 minutes before he was seen leaving. Students were still in class when he entered, and it’s unclear what he did while inside the school.

It was unclear which areas of the school he accessed. It was also unclear how he was able to enter the school, and whether he presented identification.

Police arrested him two days later after a school resource officer recognized him and confirmed it was him in the video surveillance footage.

A message left with the principal of the school was not immediately returned.