Mark Salling hurt himself in a suicide attempt a month and a half before striking a plea deal in his child porn case ... TMZ has learned.
We're told the "Glee" star was in the bedroom of his L.A. area home on August 22 when he cut both of his wrists. We're told Mark "freaked out" and screamed for his roommate, who discovered him bleeding and called 911.
Paramedics rushed to the home where they treated Mark, put him in an ambulance and took him to the hospital.
We're told Mark was taken for psychiatric evaluation, and days later, was taken to a rehab facility for psychological issues.
Mark's arms are scarred, which is apparently why he's been wearing long sleeves in the Los Angeles heat.
As we reported, Salling copped a plea in his child porn case earlier this month ... a case that was filed after cops found more than 50,000 images of child porn and child erotica on his personal computer.
The prosecution recommended 4 to 7 years in prison under the plea deal. The judge has yet to impose a sentence.
Mark's lawyer denies the story but will not say which details are incorrect, adding, "Mark is physically fine and Mark is spending his time atoning and working on himself."