Sobbing with joy, Courtney Love thanked a judge Monday after he terminated her probation and dismissed three misdemeanor cases, including two drug-related charges.

"Thank you for not taking me into custody," Love told Superior Court Judge Rand Rubin. "Thank you for giving me an opportunity. You've been a good, fair judge. Sorry for crying."

Love, 42, the former frontwoman of rock band Hole and widow of Nirvana singer Kurt Cobain, appeared in court dressed in a black striped suit and white blouse. She was accompanied by her manager, Peter Asher, and her lawyer, Howard Weitzman.

In September 2005, Love was sentenced to 180 days at a drug treatment facility for violating probation in the cases — one for illegal possession of painkillers, one for being under the influence of a controlled substance in public, and another for assault and battery.

"Early on in this case, Ms. Love, I think you came very close to coming into custody," Rubin said. "I think you've done very well. You've shown to me you are interested in a much less destructive lifestyle."

Rubin said he was aware of the possibility of a relapse, but told Love he wanted "to cautiously wish you the best in this matter."

Attorney Gloria Allred appeared in court with her client, musician Kristin King, with a request for the judge to maintain a protection order against Love.

Love pleaded no contest in February 2005 to misdemeanor assault involving King and was sentenced to three years' probation. She also paid King $2,705 in restitution.

On Monday, Allred recounted that King was "viciously attacked by Ms. Love" in April 2004 while she was sleeping on a couch at the home of Love's former boyfriend and manager.

Allred said Love poured whiskey on King, dug her fingernails into King's arm, slapped her and chipped one of King's teeth.

Weitzman answered that "we've denied 99.9 percent of the allegations."

The judge went on to dismiss the protective order.

"I have a feeling they will stay away from each other," he said.

After the hearing, Allred and Deputy District Attorney Gina Satriano both declined to comment. Allred's client passed by Love and said loudly, "Ah karma."

Love, kissing and hugging her attorney and manager outside court, said she would remain committed to her sobriety.

"All she has left to do is continue as she's been doing," talking to Alcoholics Anonymous counselors and mentoring others, Weitzman told The Associated Press.

"Out of my own free will!" Love added.