Lindsay Lohan sidestepped another jail stint Friday when a California judge sent the 24-year-old troubled starlet back to rehab, telling her she was an addict and faced jail time if she relapsed again.
Los Angeles Superior Court Judge Elden S. Fox ordered Lohan to remain at the Betty Ford Center until Jan. 3 and report back to court in late February.
A prosecutor had advocated a six-month jail sentence for the "Mean Girls" star, but Fox opted for rehab after reviewing filings by probation and rehab officials and a letter written by Lohan.
Lohan cried after hearing the sentence.
The judge acknowledged that Lohan, 24, has been in-and-out of court and rehab since a pair of high-profile arrests in 2007. He told the actress that he would not be manipulated by her, but was giving her a final chance to stay clean.
"You're staying past the New Year's -- there's a reason for that," Fox said.
Fox's sentence means Lohan will not be returning to a suburban Los Angeles women's jail for a fourth time.
The judge had threatened to send Lohan to jail for 30 days for each drug test she skipped or failed. He ordered her held for nearly a month during a hearing in September, but another judge overturned his ruling and Lohan has been free on bail and in inpatient rehab voluntarily since then.
Lohan is due back in court on February 25.
Friday's hearing was Lohan's fifth court appearance since May, when she ran into trouble with her probation for missing several weekly counseling sessions. She later spent 14 days in jail and 23 days in rehab as punishment.
Her legal woes are the result of drug and drunken driving charges being filed in 2007 after a pair of high-profile arrests. Lohan pleaded no contest to two counts of driving with a blood-alcohol level above 0.08 percent and one count of reckless driving. She was sentenced to three years of probation, but that was later extended after the actress didn't complete the terms of her sentence in time.
Fox allowed her to be released from rehab early based on the recommendations of her doctors and laid out a path for her to be taken off probation by the end of the year. His regimen included frequent counseling sessions, meetings with probation officials and random drug screenings. It also included several incentives, including an assurance that if the actress complied with the terms for 67 days, her probation oversight would end and she would be free to move from Los Angeles.
Within weeks of her release from rehab, Lohan failed a drug test. She acknowledged the result in postings on Twitter and said she was struggling with addiction.