Mark Salling appears to be taking some responsibility for his actions.
Just weeks before the "Glee" star was set to stand trial in his ongoing child pornography case, E! News has learned that the actor has entered a plea agreement.
In court documents obtained by E! News, the defendant plans to plead guilty to possession of child pornography involving a prepubescent minor.
Salling has agreed to serve four to seven years behind bars and will be under supervised release for 20 years. He will register as a sex offender and will pay restitution to each victim who has requested it.
E! News has learned that the plea agreement still has to be accepted by the judge. The trial is also still set for Oct. 17.
We've reached out to Salling's attorney for any additional comment.
Back in May of 2016, the "Glee" star was charged in a federal indictment with allegedly receiving and possessing child pornography, according to the U.S. Attorney's Office.
"Those who download and possess child pornography create a market that causes more children to be harmed," U.S. Attorney Eileen M. Decker said in a statement. "Young victims are harmed every time an image is generated, every time it is distributed, and every time it is viewed."
Mark is most known for his role as high school jock Noah "Puck" Puckerman on "Glee." The Fox series ran from 2009 to 2015.
Most of his co-stars have stayed silent on his legal troubles except for former co-star and ex-girlfriend Naya Rivera who shared her reaction to his indictment in her book "Sorry Not Sorry."
"I can't say I was totally shocked, but still–WTF?" she wrote. "My son's nanny actually told me about it when the story broke. Then I had no doubt that God really did have my back along the way."