Troubled actress Lindsay Lohan copped a plea deal in Los Angeles County Superior Court Monday to avoid jail time. Maybe it was all that glitter that was thrown on her as she was entering the courthouse?

The “Mean Girls” star was “glitter-bombed” with gold sparkles on her way into court to find out if she’d be doing another stint in prison. Instead, she will be spending 90 days in lockdown rehab, TMZ reported. The starlet was able to avoid jail time once more.

Lohan pled no contest to the crimes of reckless driving and lying to police officers.

In addition to being forced into rehab, the famous redhead will have to perform 30 days of community service and undergo psychotherapy for 18 months. Any therapy she has completed in rehab will count.

Reckless driving usually comes with a five-day jail sentence, but Lohan won’t be spending a second behind bars since she’s going to rehab. She’ll be able to do her rehab in New York City, where she’ll be close to her mother and siblings. Naturally she’ll also have to stay away from drugs and alcohol and take drug tests.

If Lohan continues to obey all laws, she won’t serve any of the 180-day jail sentence she received for the jewelry heist case in 2011.

Judge James Dabney also offered a helpful suggestion to Lohan: “Don’t drive.”

During the hearing, the actress got irritated with her attorney Mark Heller after he kept jumping up to talk, TMZ reported.

Eventually, Lohan’s patience ran out and she supposedly yelled at her attorney: "Don't say anything else."

After Heller ignored her and stood up to talk again, she lamented, "Oh my god, I'm going to kill you."

The 26-year-old was already having a dramatic day after she missed two commercial flights from New York to Los Angeles and ultimately arrived to her hearing 48 minutes late after being forced to take a private jet.

Being pelted with glitter as she entered the courtroom probably didn’t help Lohan’s frustration either. The unidentified "glitter-bomber" was not arrested, the Los Angeles Times reported, and authorities don't plan on pursuing her. Glitter has been thrown at many politicians, public figures and celebrities and isn't usually considered a criminal offense.