Former "Glee" star Mark Salling pleaded guilty Wednesday to possession of child pornography and could face four to six years in prison.

After Salling was arrested last December, federal investigators said that they found more than 25,000 images and 600 videos depicting child pornography on Salling's computers and flash drives. According to court documents obtained by the Blast, some of the content depicted the abuse of children as young as 3 years old.

The documents also revealed that Salling used software to mask his downloading activities, but was reported to police by an ex-girlfriend.

As part of the plea agreement, the 35-year-old actor will be required to register as a sex offender; enter a treatment program; have no contact with anyone under the age of 18, and stay 100 away from schools, parks, playgrounds, youth centers, and arcades. He will also pay $50,000 in restitution to each victim who requests it.