Lindsay Lohan is going to rehab for 90 days.

The 26-year-old actress - who arrived to court in Del Aire, in Los Angeles County 48 minutes late today (18.03.13) - plead ''no contest'' after striking a last minute deal with prosecutors in relation to charges for lying to police about driving her Porsche when she hit a cement truck on the Pacific Coast Highway last June while still on probation for stealing a necklace.

The 'Liz & Dick' star was also sentenced to 30 days of community service and 18 months of psychotherapy, two months of which she has already completed.

The troubled starlet will be allowed to complete her community service in New York after her stint in rehab and her lawyer Mark Heller will appear in court on May 2 to give a progress report.

The judge advised the actress - who was showered with glitter by a fan before entering the court - ''don't drive'' and warned her that this was her last chance to escape jail.

He said if she violates her probation again, ''we are going to be done with it,'' before adding: ''This is it.''

The actress, whose estranged father Michael was in court to support her, won't be allowed to leave her selected rehab facility at any stage during her treatment and must stay clear of drugs, drug users and submit to regular drug testing.

Mr. Heller admitted he was relieved the case came to a ''successful conclusion'' and said he is ''very confident'' she will be able to move forward in her life with ''dignity, with pride and with respect''.

He added: ''At the conclusion of this case, Lindsay will have a completely clean record. I think that is an extremely important element to this case.''