Danny Masterson had 2 of his "That '70s Show" costars in his corner ahead of his sentencing ... Ashton Kutcher and Mila Kunis wrote letters of support for the actor.
The letters, obtained by Tony Ortega, were sent to Judge Olmedo before Masterson received his 30-year to life sentence in L.A. -- and both outlined the long-running friendship they've shared with the actor, going back to them working together on the sitcom.
Ashton says, "Danny has been nothing but a positive influence on me. He's an extraordinarily honest and intentional human being." He goes on to gush over Masterson's ability to be there for him over the years, citing Masterson as the reason why he never slipped into the "typical Hollywood life of drugs."
He even recalls a time when Masterson came to a random woman's defense as she was getting berated by her boyfriend at a pizza parlor, ending the letter by saying, "having his daughter raised without a present father would [be] a tertiary injustice in and of itself."
Mila echoed Ashton's claims, adding it has been a "privilege" to be a part of Masterson's life ... and saying his role as a dad and husband has been "nothing short of extraordinary."
As we reported, Masterson was sentenced to three decades behind bars on Thursday for his two rape convictions.
His team told us they spotted "a number of significant evidentiary and constitutional issues" in the trial and will be bringing up these arguments on appeal. We also learned he's being watched like a hawk while locked up for signs of mental distress.
We covered the story on the latest episode of The TMZ Podcast, available on all podcast platforms.
Do you believe 30 years is a fair sentence for Danny Masterson? Sound off by answering the question in our game below.