Lindsay Lohan COPS PLEA DEAL -- AVOIDS JAIL

Lindsay Lohan

COPS PLEA DEAL

AVOIDS JAIL

3/18/2013 11:35 AM PDT BY TMZ STAFF

breaking news

Lindsay Lohan just copped an 11th hour plea deal and will spend 90 days in lockdown rehab ... the good news for her ... she's dodged the jail bullet.

After a lot of haggling in chambers with offers and counteroffers, Lindsay pled no contest to the crimes of reckless driving and lying to cops. In addition to rehab, Lindsay will perform 30 days of community labor and undergo psychotherapy for 18 months -- she'll get credit for shrink time already completed.

FYI -- there's a mandatory 5 days in jail for reckless driving, but it's going to be folded into the lockdown rehab so she won't be behind bars even for a day. Lindsay will be able to do her rehab in NYC. She must stay clear of drugs and drug users. She must submit to drug testing.

She's also admitted to a probation violation in the jewelry heist case, she was sentenced to 180 days in jail, but that sentence was STAYED and she won't do time if she continues to obey all laws.