Ex-'Glee' star Mark Salling gets prison in child porn case

FILE - In this March 13, 2015 file photo, Mark Salling arrives at the 32nd annual Paleyfest "Glee" held at The Dolby Theatre in Los Angeles. Prosecutors filed 
a plea agreement on Tuesday, Oct. 3, 2017, in which Salling agrees to plead guilty to possession of child pornography in a case filed after investigators found more than 50,000 images of child porn on his laptop in December 2015.  (Photo by Richard Shotwell/Invision/AP, File)

Mark Salling, seen here in 2015, faced up to 20 years in prison if convicted of the charges  (Richard Shotwell/Invision/AP)

Former "Glee" star Mark Salling pled guilty to possession of child pornography involving prepubescent minors on Tuesday. He will serve between four and seven years in prison.

As part of the plea, the actor will have to register as a sex offender, enter a treatment program, have no unsupervised contact with anyone under the age of 18 and stay away from schoolyards, parks, swimming pools, playgrounds and video arcades, according to court documents obtained by The Blast.

Salling, 35, was also ordered to pay $50,000 in restitution to each victim of the child pornography who has requested it.

The documents reveal that Salling knowingly downloaded thousands of images of child pornography between April and December 2015, hiding the activity with software that masked his IP address. He was eventually caught after he showed the images to a woman he was in a relationship with, who reported the actor to authorities.

Salling was arrested on Dec. 29, 2015, after a search of his Los Angeles-area home three days prior turned up thousands of files of child pornography on his laptop, a thumbnail drive and an encrypted hard drive.

Click for more from the New York Post.