Lindsay Lohan will spend the holidays in rehab.
To the surprise of legal observers and a Los Angeles County prosecutor, who had urged the maximum 180 days jail time, the judge in Lohan's probation violation hearing Friday morning allowed the actress to remain in inpatient rehab through Jan. 3.
Los Angeles Superior Court Judge Elden S. Fox issued the ruling in response to Lohan having failed drug tests this year while on probation for her 2007 conviction on drunken driving charges.
Though he had vowed to send the "Mean Girls" star to jail for 30 days for each drug test she skipped or failed, he was giving her, he said, a final chanceto stay clean.
"You are an addict, I hope you understand that," Fox told Lohan, 24, who nodded, The Associated Press reported.
He stipulated if she does not test positive for drugs or alcohol by her next court hearing Feb. 25, he would let her to complete her probation unsupervised.
Fox told the actress that her substance abuse would "destroy what is a very lucrative career and profession."
Fox said he was sentencing her to rehab "past the New Year's - there's a reason for that." Another violation would again threaten 180 days in jail, prosecutors told AP.Lohan, who wore a black pantsuit to court, her hair pulled back into a ponytail, attended the hearing with her mother and manager, Dina Lohan.