A former Herndon High School teacher accused of taking inappropriate photos of dozens of students and possessing thousands of images of child pornography and other lewd material pleaded guilty to multiple charges in Fairfax County Circuit Court on Monday.

Raphael Schklowsky, 38, of Reston admitted his guilt on nine counts as part of a deal with Fairfax County prosecutors. Schklowsky faces up to 37 years in prison when he is sentenced on Sept. 3 but probably will get a far shorter sentence.

Schklowsky, who taught drama and directed school plays, surreptitiously snapped photos up skirts and down blouses with his iPhone in the school between May 2017 and June 2018, prosecutors said. Police also said he planted a small camera in a dressing room to capture video of students as they changed.

The case is one of a number in recent years that show how voyeurs armed with cellphone technology, ever smaller cameras and even drones have been able to capture troves of inappropriate images of people.

Authorities said a search of Schklowsky’s phone and electronic devices turned up about 8,000 lewd images. Investigators said they were able to identify 10 victims, but the identity of many others could not be determined from the images. Schklowsky was arrested in April 2019.

Schklowsky’s activities at the school went undetected until an au pair living in his home discovered a small camera placed in a vent in her bedroom and reported Schklowsky to authorities, a prosecutor said.

Schklowsky pleaded guilty to two counts of possession of child pornography, five counts of unlawful filming of a minor and two counts of unlawful filming of an adult.

“Crimes committed against young people by a person in a position of trust are particularly disturbing and will always be a priority for my office,” Fairfax County Commonwealth’s Attorney Steve T. Descano said in a statement. “As a prosecutor and a parent, my heart goes out to the victims in this case and their families.”

Edward Ungvarsky, an attorney for Schklowsky, said in a statement that his client accepts that he has forfeited his right to teach and is committed to being a good husband to his wife and a good father to his daughters.

“Raphael Schklowsky is deeply remorseful, ashamed and contrite for his offending behavior,” Ungvarsky said. “Since his arrest, Mr. Schklowsky has undergone intensive inpatient and community-based treatment and therapy that will ensure such actions never occur again.”

One of Schklowsky’s victims, who has since graduated high school, said it has been difficult to wait more than two years for Schklowsky to face his day in court.

Criminal cases in Fairfax County and elsewhere have faced lengthy delays because of the pandemic. The Washington Post generally does not name victims of crime.

“I think he should be in prison for a long time,” she said.