LOS ANGELES (AP) — Lindsay Lohan isn't headed back to jail — but she won't be free to party for a while either.
The troubled 26-year-old actress accepted a plea deal on Monday in a misdemeanor car crash case that includes 90 days in a locked-down rehabilitation facility that she won't be able to leave.
Lohan, who has struggled for years with legal problems and been briefly jailed five times, pleaded no contest to reckless driving and lying to police who were investigating the accident involving the actress in June along Pacific Coast Highway.
A charge of obstructing an officer was dropped.
Lohan also was found in violation of her probation in a 2011 necklace theft and sentenced to 180 days in jail.
However, she can avoid jail time if she complies with the conditions of her plea deal, which also includes 30 days of community labor, 18 months of psychological therapy and an unspecified fine and restitution.
Lohan spoke little to Superior Court Judge James R. Dabney in court and said "yes" when asked if she accepted the plea deal. Before the "Mean Girls" actress left the courtroom, Dabney offered her a suggestion.
"Don't drive," he said.
Dabney did not set a date for Lohan to begin rehab. Instead he set another hearing for May 2, when the court must be given proof of enrollment in a treatment program.
The sentence extends Lohan's probation for another two years. Dabney warned her that there won't be any discussion about putting her back on probation if she doesn't meet the conditions of the latest sentence.
Lohan arrived nearly an hour late for Monday's proceedings and was showered with confetti as she passed through a barrage of media to enter the courthouse.
The "Freaky Friday" star 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.
After entering the courtroom, Lohan sat for more than two hours as her New York-based attorney, Mark Jay Heller, and prosecutors ironed out a plea deal.
After a pair of arrests for driving under the influence in 2007, Lohan has resolved her numerous legal issues without 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. At one point during the proceedings, she told an incessant Heller not to "say anything else." Lohan and Heller were joined by Long Beach-based attorney Anthony J. Falangetti.
Lohan's longtime advocate, Shawn Holley, left the case earlier this year after keeping the actress out of jail for significant periods of time on probation violations and the allegation in 2011 that she took a $2,500 necklace without permission from an upscale jeweler.