Ronnie Ortiz-Magro admits he violated his probation by getting arrested for alleged domestic violence, but this must be his lucky day -- because the judge is giving him another shot.
The 'Jersey Shore' star appeared in a Los Angeles courtroom Friday, where he admitted to his probation violation, which could have meant immediate jail time -- but, instead, the court's making this a teachable moment for Ronnie.
We got Ronnie going into court and he told our photog he was hoping for good news ... and he definitely got some.
You'll recall, the D.A.'s Office said Ronnie violated probation in his domestic violence case with his ex Jenn Harley ... when he got arrestedfor an alleged incident with Saffire Matos, his latest GF.
On Friday, the judge ordered Ronnie to take 26 parenting classes, and there's now a 3-year protective order in place so he can't harass or intimidate Saffire. The judge also gave him credit for completing a rehab program in Florida, so he won't have to spend 30 days in jail.
As we first told you ... Ronnie claims he's since cleaned up his act and he's getting ready to return to the reality TV show that made him famous.
Ronnie's attorney, Scott Leemon, tells TMZ ... they're happy the court was satisfied with Ron's completion of a rehab program. We're told Ron's now been sober for 5 months and is deciding to continue with counseling as he focuses on being a better family man.
His next court date is set for March 17, but he will not have to be there in person.