ROCHESTER, N.Y. -- Former Webster elementary school teacher Terrance Hoctor admitted to using his cell phone to secretly record two of his female students changing in a school restroom in March.

He pleaded guilty to one count of unlawful surveillance in October.

At his sentencing Wednesday, he gave a tearful apology.

“I just wanted to express how sorry I am to the victims," said Hoctor, of Webster. "I can’t even come up with the words to express the level of how terribly I feel and how disgusted I am with what they had to go through. The community, and what I put them through. I hurt so many people with this. And I can’t even begin to apologize.”

Hoctor’s attorney highlighted the fact that this was a one-time incident and his client had no prior criminal record.

“He has had little or no police contact and certainly never been arrested for anything like this, let alone any other prior," said defense attorney Stephen Sercu. "He is a college graduate, he has a master’s degree, and up until this day judge, he was a very well-respected teacher.”

Several of Hoctor’s fellow teachers and community members sent character references in support of him.

But Judge Stephen Miller said he was most struck by the victims violated by their own teacher – a person they trusted.

“The one thing that was violated was trust, which you realize," said the judge. "People cared for you. The community that you served, cared for you. But at this juncture, they’ve probably lost a lot of trust in you.”

Miller sentenced Hoctor to six months in jail, followed by five years of probation.

He is also barred from contacting the victims for five years and must register as a Level 1 sex offender.

“I felt that there was a level of orchestration and thought behind the entire process, rather than just a bad mistake," said prosecutor Michael Robertson. "It seemed to be well thought out and well planned. And I believe that is something that shows, especially considering the female victims were going to the bathroom to change into another set of clothes. I felt that fit squarely within the sex offender registration statute.”

Hoctor turned in his teaching license after teaching at State Road Elementary since 2006.