Los Angeles, California (CNN) -- Actress Lindsay Lohan was ordered Tuesday to serve 90 days in jail for missing alcohol counseling sessions in violation of her probation.
The judge also ordered Lohan to spend 90 days in a drug and alcohol rehab program after her jail term is completed.
The actress must begin serving her sentence on July 20, Los Angeles County Superior Court Judge Marsha Revel said.
After Revel ruled that Lohan had violated her probation in a 2007 drunken driving conviction by missing weekly alcohol counseling sessions, Lohan began sobbing as she addressed the court. "I did do everthing that I was told to do and did the best I could," she said.
Earlier, the alcohol counseling program director testified at the probation revocation hearing that Lohan missed nine alcohol counseling sessions since December, when the judge ordered her to attend weekly classes or face jail.
Lohan has apparently not missed a weekly counseling session since May 20, when Revel ruled that there was "probable cause to believe [Lohan] is in violation of probation" from a 2007 drunken driving conviction.
Lohan was ordered not to drink alcohol and an electronic bracelet was fitted on her leg on May 24 to detect if she did.
The SCRAM bracelet measured an alcohol level of 0.03 percent in the actress' body at midnight on June 7, but reported a zero reading four hours later, Revel said during Tuesday's hearing. The alert would be a bond violation, but not a probation violation, she said.
Revel said she would consider only if Lohan missed weekly alcohol counseling sessions, as Revel ordered in December.
Cheryl Marshall, the director of the Right On program where Lohan has been attending counseling, testified Tuesday morning that Lohan would sometimes call ahead when she was going to miss a weekly session.
A report from the program to the judge said Lohan "kept making up creative excuses" about her absences, prosecutor Danette Meyers said.
Lohan's father, Michael Lohan, was in court for the hearing. The judge denied him a chance to speak, although she did accept a letter from him. Michael Lohan has been calling for the court to order his daughter into alcohol and drug rehab.