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.
After Lohan left the courthouse, her father, Michael Lohan, who brought his own legal team to the proceedings, confronted Heller and Falangetti.
Michael Lohan told reporters that Heller was being investigated for witness tampering in the case and was not being paid by his daughter. Instead, Lohan said the attorney took the case to gain media attention. Heller did not respond to the claim by Lohan at the courthouse. A call to his New York office was not immediately returned.
"Go home," Michael Lohan called out to him. "You have done enough damage. Leave my daughter alone and stay out of the press. You're a parasite."
Lohan, who's had a strained relationship with his daughter over the years, was restrained by his attorney and separated from Heller and Falangetti by a sheriff's deputy.
Heller "is her official representative," Falangetti told Lohan. "You are not."
Lindsay Lohan has been a courthouse mainstay since 2010 when she failed to appear for a probation hearing because she claimed she lost her passport in France.
By that point, she had already been on probation for nearly three years on the pair of driving under the influence cases that took the former Disney star five years to resolve.
Lohan has been under some form of probation since her 2007 convictions and has been repeatedly sent to jail and rehab for violations ranging from failing to perform her community service to skipping counseling sessions.
All her jail stints have been short because she has only been convicted of misdemeanors and because of jail overcrowding.
Out of court, Lohan has struggled to regain her stature in Hollywood. She missed the premiere of "Machete" in 2010 because of her court troubles, and her acting return in 2012's "Liz & Dick" was widely panned by critics and viewers.
Her next project is "The Canyons," a film by Bret Easton Ellis that also features porn star James Deen.
Lohan relocated to New York after work on the movie was complete, but her return to her childhood home has had its share of drama. She has been arrested twice, though not charged, for late-night incidents in which she has been accused of hitting a man with her car and striking a woman at a Manhattan nightclub.
Prosecutors decided last year that Lohan would not face criminal charges and wouldn't elaborate on their decision about the Sept. 21 episode involving Jose Rodriguez, 34, of Jersey City, N.J.
Police also had to be called to Lohan's childhood home on Long Island after a report of a fight between her and her mother. An investigation revealed what authorities called "no criminality."
Follow AP Entertainment Writer Derrik J. Lang on Twitter at http://www.twitter.com/derrikjlang.
AP Entertainment Writers Anthony McCartney and Ryan Pearson contributed to this report.