Lindsay Lohan accepted a plea deal on Monday in a misdemeanor car crash case that includes 90 days in a rehabilitation facility.
The actress, who has struggled for years with legal problems, pleaded no contest to reckless driving, lying to police and obstructing officers who were investigating the accident involving the actress in June.
A judge said Lohan will be sentenced to 90 days in rehab, 30 days of community labor and 18 months of psychological therapy.
Before the "Meal Girls" actress left the courtroom, Superior Judge Superior Court Judge James R. Dabney offered her a suggestion.
"Don't drive," he said.
Lohan was on probation when her sports car crashed on Pacific Coast Highway while on her way to a film shoot.
The 26-year-old actress has been repeatedly sentenced to jail since 2007 when she was twice arrested for driving under the influence.
A hearing had been set to begin at 8:30 a.m., and Lohan arrived after 9 a.m. She looked slightly frazzled in a cream-colored ensemble.
Her lawyers and a prosecutor met with the judge in chambers for more than two hours before Lohan entered the plea.
Attorney Mark Jay Heller, who represents Lohan, left the chambers several times to confer with her in a courtroom hallway.
Lohan previously pleaded not guilty.
She could face up to 245 days in jail if a judge determines she violated her probation in a 2011 theft case.
Lohan reportedly missed her original Sunday night flight from New York to Los Angeles, instead traveling on a private plane provided by a Los Angeles-based energy drink company for which she has made promotional appearances.
"Thanks Mr. Pink for the private jet see you all in a few hours in LA," she tweeted early Monday.
Lohan has resolved her numerous court problems without ever going to trial. Instead she has faced judges who have sentenced her to rehab and counseling, which even her current attorney acknowledges have not completely helped the troubled actress.
Lohan entered Monday's hearing with a lawyer whose competence has been questioned by a judge, and another set of attorneys waiting in the wings to take over.
She did not, however, have her longtime advocate, Shawn Holley, present. Holley left the case this year after keeping the actress out of jail for significant periods of time on probation violations and allegations in 2011 that she took a $2,500 necklace without permission from an upscale jeweler.
The former Disney star has been under some form of probation since 2007, and her court troubles have stifled a once-promising career.
Lohan's return to acting last year in the Lifetime movie "Liz & Dick" was widely panned by critics and viewers. Her upcoming film by Bret Easton Ellis, "The Canyons," co-stars porn star James Deen.
Prosecutors decided last year that Lohan would not face criminal charges after being accused of clipping a man with her car outside a Manhattan nightclub.
Prosecutors wouldn't elaborate on their decision about the Sept. 21 episode involving Jose Rodriguez, 34, of Jersey City, N.J.