After fudging her flight from New York and nearly missing her date in court on Monday (March 18), Lindsay Lohan cut a plea deal with prosecutors in a June car-accident case and avoided jail time.

Instead, Lohan — who was facing up to eight months in jail — agreed to plead no contest to reckless driving and lying to police and was ordered to spend 90 days in a lockdown rehab facility, with no in-and-out privileges. She was also ordered to do 30 days of community labor and submit to 18 months of psychotherapy and pay several hundred dollars in fines.

Lohan was in court again after being accused of lying to police about a June 2012 car accident. When asked if she understood the terms of her deal, Lohan — who sat impassively during much of the proceeding — said, "Yes, your honor."

In addition, she admitted that her actions violated her probation in a previous jewelry-theft case, which landed her a sentence of 180 days in jail. The judge agreed to stay that sentence as long as the actress kept out of trouble.

"A suggestion: Don't drive," the judge told Lohan after reading her sentence. "This is it: You violate your probation and we're not going to be having discussions," he added, warning that any future probation violation will send her directly to jail, with no more chances to avoid doing time.