LOS ANGELES (CNN) -- Pop singer Britney Spears must submit to random drug tests, a judge has ordered after finding she engaged in "habitual, frequent, and continuous use of controlled substances and alcohol."
Kevin Federline and Britney Spears are in the middle of a bitter custody battle over their two sons.
The ruling by Superior Court Commissioner Scott Gordon provided no details and did not name any specific drugs, stating only that the findings were "based on the evidence presented."
Spears must also spend eight hours a week working with a parenting coach who will observe her interactions with her children, according to the ruling released Tuesday.
Efforts to contact the singer's lawyers, Marci Levine and Mel Goldman, were unsuccessful late Tuesday.
The ruling comes during Spears' custody battle with ex-husband Kevin Federline.
The documents underscore the bitter nature of the fight over their two sons, Sean Preston and Jayden. The two have split custody equally, but Federline is asking for the arrangements to be shifted to 70-30 in his favor.
After a closed hearing Monday, Gordon ordered Spears, 25, to undergo random drug tests twice a week. He told both parents to avoid alcohol or "other non-prescription controlled substances" 12 hours before taking custody of the children.
He also barred the exes from making "derogatory remarks about the other party and the other party's family or significant other" during the case, ordered them to go through "joint co-parenting counseling" and barred them from using corporal punishment on the boys.
Spears and Federline were married for two years before their divorce was finalized in July. Federline's attorney, Mark Vincent Kaplan, told reporters on Monday he didn't see the custody battle being resolved before scheduled hearings in November and December.
Tuesday's order comes amid a career freefall for Spears, who has a new album due in stores November 13. Critics said her September 9 "comeback" performance on the MTV Video Music Awards was lackluster and said she appeared overweight in her sequined, two-piece costume.
Her former divorce lawyer, Laura Wasser, resigned as her legal representative in the past few days after defending her outside the courthouse on Friday, telling reporters the singer "just wants to be a mom."
And Spears' management company, the Firm, has quit after representing the singer for a little more than a month.
"It saddens us to confirm media reports that we have terminated our professional relationship with Britney Spears," the company announced Monday. "We believe Britney is enormously talented and has made a terrific record, but current circumstances have prevented us from properly doing our job. We wish Britney the best." E-mail to a friend