Singer Courtney Love has been sentenced to 18 months in drug rehabilitation after she admitted being under the influence of cocaine and opiates.
Ms Love still faces another drug charge and two assault charges
The star is now banned from taking non-prescription drugs, drinking alcohol or being in places that serve alcohol.
The 40-year-old must enrol in a drug counselling programme by 29 October, Los Angeles Superior Court ruled.
The ex-Hole star must still face a separate drug possession charge, and two unrelated assault charges.
Ms Love's sentence on Tuesday resulted from her arrest in October, when she allegedly tried to break into the Los Angeles home of boyfriend Jim Barber.
An additional charge of being drunk and disorderly in public was dismissed on Tuesday at the prosecutor's request.
"I have to stop drinking. That's funny," Ms Love said outside court, lighting a cigarette. "I think I can do it."
The singer must still face a charge in Beverly Hills Superior Court of allegedly possessing illegal painkillers during the October incident.
She could face up to three years and eight months in prison if convicted of possessing hydrocodone and oxycodone.
Ms Love is the widow of Nirvana frontman Kurt Cobain
In a separate case, Love will face charges of assault and reckless endangerment in New York City on 20 August, after she allegedly struck a fan with a microphone stand at an East Village club in March.
In another case, an arrest warrant was served on Love after she allegedly attacked a 32-year-old woman with a bottle at Barber's Los Angeles home in April.
Love and her new band, The Chelsea, were scheduled to begin a tour last month to support her recent album America's Sweetheart.
But Love delayed the tour amid her legal cases. Whether Tuesday's sentence will allow her to perform in music venues where alcohol is served is unclear.