WESTHAMPTON - A former East End teacher accused of videotaping young girls in a school locker room took a plea deal in court today.

Former Westhampton Middle School gym teacher Thomas Sheppard changed his not guilty plea to guilty, admitting that he intentionally placed his cellphone in the girls’ locker room and video recorded seven of his students in February.

As part of his plea deal, the 27-year-old will receive five years of probation, give up his teaching license and register as a sex offender.

Sheppard faced charges of felony unlawful surveillance and endangering the welfare of children. If convicted, he would have faced up to four years in prison.

He will be officially sentenced on Dec. 18.