A former educator has admitted that he secretly videotaped teenage boys in the shower at a Catholic high school in northern New Jersey for nearly four years.

Patrick Lott (Somerset County Prosecutor's Office)

Patrick Lott of Somerville pleaded guilty Wednesday to 30 counts of child endangerment and 29 counts of invasion of privacy. He faces up to six years in prison when he's sentenced Aug. 23.

Somerset County prosecutors say Lott videotaped students in a communal shower area at Immaculata High School in Somerville, starting in January 2007. He had been a longtime volunteer and coach at the school and also was active in local and county politics, serving for a time as chairman of the Somerville Republican Committee.

Lott had been an assistant principal at the Bernardsville Middle School, but he resigned that post in January 2012.

Authorities have said there were 22 victims, including nine boys who are under the age of 16. Immaculata officials alerted prosecutors when they received allegations of inappropriate conduct by Lott and later removed him from any involvement at the school.

Prosecutors say the video recordings were recovered at Lott's home in December 2011. But they have not commented on how Lott was allegedly able to install the cameras.

(Copyright 2013 by The Associated Press. All Rights Reserved.)