Former “Glee” star Mark Salling pleaded guilty to possession of child pornography involving a prepubescent minor as part of a plea bargain.

The actor was facing two counts of child pornography after police found over 50,000 images of child erotica on his computer and another 4,000 on a flash drive. According to the deal, he agreed to make restitution to the victims, paying “approximately $50,000” to each who has requested it.

RELATED: “Glee” alum Mark Salling is under investigation again after a woman came forward with horrific allegations

Salling could have gone to prison for up to 20 years, but prosecutors agreed to having him serve four to seven years in prison with 20 years of supervised release. Upon release, he will be required to register as a sexual offender and cannot have any communication with anyone under 18 without a parent or legal guardian present. As a result, he won’t be allowed to live within view of and must stay 100 feet away from schoolyards, parks, public swimming pools, playgrounds and video arcade venues.

The actor was initially arrested in December 2015 after police were tipped off that he had a trove of child pornography in his home. After the horrifying discovery, Salling was cut from the film “Gods and Secrets.”

In a 2016 memoir, Salling’s ex-girlfriend and former “Glee” co-star Naya Rivera wrote that she wasn’t “totally shocked” by the charges against him.

RELATED: This “Glee” star had his day in court after receiving two counts of child pornography charges

“Glee” star Mark Salling enters his plea to horrifying child pornography charges Photo by Richard Shotwell/Invision/AP, File
Carlin Becker About the author:
Carlin Becker is an Associate Content Editor at Rare. Follow her on Twitter @_carlbeck.
View More Articles
Watch the 2017 Rare Country Awards