A former Westhampton Beach Middle School gym teacher admitted Wednesday to using a cellphone to secretly record video of female students in the locker room.

Thomas Sheppard, 28, of Speonk, pleaded guilty in Suffolk County Court in Riverhead and is expected to get five years of probation, give up his teacher's license and register as a sex offender, according to the terms of a plea deal agreed upon by Judge Barbara Kahn.

advertisement | advertise on newsday

"He's quite remorseful for his actions and wanted to spare the community any further trauma by pleading guilty," Sheppard's attorney, Peter Brill of Hauppauge, said.

Sheppard is scheduled to be sentenced Dec. 18.

The Westhampton Beach school board accepted his resignation Monday, effective the next day, and the state Education Department was notified, according to a statement from Michael R. Radday, Westhampton Beach superintendent.

Sheppard had been suspended with pay until the case was resolved With Andrew Smith