SACRAMENTO (CBS13) – A former Natomas-area teacher has been sentenced to jail time and will have to register as a sex offender.

Scott MacMillan was a teacher at Heron School. Back in 2017, he was arrested after an investigation into accusations he was using his cellphone to try and take inappropriate pictures of students.

READ MORE: Arrest Made In Killing Of Woman Near Florin Light Rail Station

Detectives say students saw MacMillan use his phone to record a 12-year-old girl under her desk.

Police investigators later seized MacMillan’s phone and found images of what looked like girls’ private parts.

READ MORE: Fans React To Closure Of Orangevale Music Venue The Boardwalk

Back in Oct. 2017, MacMillan pleaded no contest to charges of attempted possession of child porn, attempted use of a concealed camera to take photos of an adult victim for sexual purposes, and use of a concealed camera to take photos of a minor for sexual purposes.

Monday, MacMillan was given a sentence of 30 days in county jail and 3 years of probation. He will also be required to register as a sex offender, according to the Sacramento County District Attorney’s Office.

MORE NEWS: Controversial New Report Says No Amount Of Alcohol Is Good For The Heart

In a statement, the Natomas Unified School District said MacMillan was put on leave during the initial investigation. MacMillan resigned once the district began termination proceedings, officials say.