'Glee' actor Mark Salling pleads guilty to possession of child pornography

Mark Salling admitted to downloading thousands of images of child pornography.

As part of the plea agreement, which was filed in the U.S. District Court for the Central District of California on Tuesday, the court could also impose on Salling a sentence including 20 years of supervised release, restitution of at least $50,000 to each victim who requests it, and other fines and fees.

The actor will also be required to register as a sex offender.

Salling, 35, was indicted in May 2016 on two counts of receiving and possessing child pornography, about five months after he was arrested by the Los Angeles Police Department. At the time of his arrest, a computer, hard drive and thumb drive containing of approximately 25,000 still images of child pornography, approximately 600 videos of child pornography and approximately 29,000 images of child erotica were seized from his home, according to the plea agreement.

Salling is best known for playing Noah "Puck" Puckerman on "Glee" from 2009-2015. An attorney for the actor did not immediately respond to ABC News' request for comment.