Glee star Mark Salling cut both of his wrists in a supposed suicide attempt before agreeing to a plea deal over child pornography possession, according to a report

Glee star Mark Salling cut both of his wrists in a supposed suicide attempt before agreeing to a plea deal over child pornography possession, according to a report.

Salling, who could be facing between four and seven years in jail after admitting to having 50,000 images of children in his home, is said to have 'freaked out' after hurting himself on August 22.

He is thought to have been taken to hospital after paramedics treated him in his Los Angeles home.

According to TMZ, he had screamed for his roommate after cutting his wrists.

The roommate then called 911 and helped him.

Salling, 35, was reportedly taken to be treated for psychological problems after he recovered.

TMZ is also reporting that he has been wearing long-sleeved shirts in a bid to hide the scars on his arms.

In a message to the website, Salling's lawyer said: 'Mark is physically fine and Mark is spending his time atoning and working on himself.'

As part of his plea deal, he had to admit to a court that authorities retrieved massive quantities of child porn from his home in a December 2015 raid.

Law enforcement in the raid found more than 50,000 images of child pornography on a laptop, with another 4,000 images and 160 videos on a flash drive, according to the plea deal.

The actor was originally facing a maximum sentence of 20 years behind bars after being charged with two counts of child pornography last year.

According to the court documents - first obtained by The Blast - Salling 'downloaded thousands of images of child pornography' between April and December 2015. Pictured right: Salling in Glee

The actor was originally facing a maximum sentence of 20 years behind bars after being charged with two counts of child pornography last year

Guilty: The plea agreement obtained by Dailymail.com is signed by the 35-year-old actor

After being released from prison, he is banned from coming within 100 feet of schoolyards, parks, public swimming pools, playgrounds and video arcade venues; cannot communicate verbally or electronically with any person under 18 without their parent or guardian present; and will also have to enter a sex offender treatment program as part of the plea deal.

The agreement also states that Salling has been ordered to pay 'approximately $50,000' restitution to each victim who has requested it.

According to the court documents - first obtained by The Blast - Salling 'downloaded thousands of images of child pornography' between April and December 2015.

Errand: On Monday, Mark was still wearing the same black long-sleeved top and blue Nike track pants he was spotted in last week while shopping at 7-11

Savoring his freedom: The flip-flop-clad felon bought a two-liter of Sprite soda and a pack of Marlboro cigarettes at the convenience store

Atonement: Salling has yet to be sentenced for his crimes

The papers state he used software to mask his IP address, but twice showed some of his collection to an adult woman, who ultimately reported him to police.

Following the tip-off, Salling was arrested in December 2015 at his home in Sunland, California, where police found a cache of explicit images on his computer depicting children as young as 10 in sexual situations. They later discovered more than 50,000 photos and videos on his laptop and another 4,000 on a flash drive.

He has yet to be sentenced.