Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Denver doctor accused of videotaping young, naked patients and posting child pornography on social media has pleaded guilty, federal prosecutors in Colorado said Friday.

Justin Neisler, 31, pleaded guilty on Thursday to the production of child pornography and faces at least 15 years and up to 30 years in prison, the U.S. District Attorney’s Office for Colorado said in a statement.

"There are few violations of trust worse than when a doctor takes advantage of a child in the exam room for his own sexual gratification," U.S. Attorney for the District of Colorado Jason Dunn said in a statement. "Thankfully, Dr. Neisler was caught and will never again be in a position to harm children under the guise of helping them."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Neisler was arrested in March following an FBI investigation that began in October 2018 when officials at Tumblr reported that he kept repeatedly posting child pornography to his account, according to court documents. A plea agreement says he "re-blogged" them so others could view the images.

Federal prosecutors said that the FBI found around 6,600 still images and 1,725 videos of child pornography on his electronic devices, which he got through the internet.

Neisler also admitted to secretly recording medical exams of minors while serving as a doctor, using a spy camera and an iPhone, prosecutors said.

Sentencing is scheduled for May 22. He was fired by the company that owns St. Anthony North Family Medicine, where he was in the family medicine residency program.

Neisler had been charged with multiple counts of production of, possession of, and transportation of child pornography.

A plea agreement says that prosecutors agreed to dismiss the other counts in exchange for the guilty plea, and that prosecutors agreed to recommend a sentence of no more than 25 years.

Neisler said in the plea agreement that he never touched any of his minor patients inappropriately but did record some of them. He said in the document that he had been watching child pornography since he was 11 and had been worried about being arrested for 20 years.