KANSAS CITY — A former Missouri teacher was sentenced Tuesday to 20 years in prison for secretly recording videos of three teenagers in his bathroom, federal prosecutors said.

A court also ordered William Derek Williams, 40, of Cameron to serve 10 years of supervised release following his incarceration. He pleaded guilty in August to one count of producing child pornography.

Williams, a former high school language arts teacher, was working as a part-time high school multimedia teacher at the time of the offense, the U.S. attorney's office said in a news release.

He admitted in his plea deal to filming three victims over a five-year period from January 2013 to September 2018 while they were in the basement bathroom of his home.

Prosecutors say a then-15-year-old victim discovered the hidden camera, which was designed to look like a cell phone charger plug. The teenager took out the micro memory card and inserted into into his cell phone to look at it. On it, he found the secretly recorded video of himself. 

After the teenager turned the device over to investigators, authorities executed a search warrant at Williams' home and seized a laptop computer and a memory card which contained pornographic videos of two more teenage victims.