LOS ANGELES, California (CNN) -- A court has ordered pop singer Britney Spears to give up custody of her children effective Wednesday at noon.

Kevin Federline and Britney Spears, here during happier times, have two children.

Spears' former husband, Kevin Federline, is to retain custody of their two sons "until further order of the court," according to a ruling by Superior Court Judge Scott Gordon.

It was not clear what led to Monday's decision awarding Federline full custody. A transcript of the court proceedings was ordered sealed.

Last month, a judge ordered Spears, 25, to submit to random drug tests after finding she engaged in "habitual, frequent, and continuous use of controlled substances and alcohol."

That order, also by Gordon, provided no details and did not name any drugs.

The former couple has been embroiled in a bitter custody fight over their sons, Sean Preston and Jayden.

The parents had split custody 50-50, but Federline then asked for the arrangements to be shifted to 70-30 in his favor.  Watch how Spears became user of -- and prisoner to -- fame »

In addition to ordering the twice-weekly drug tests, Gordon ordered Spears to spend eight hours per week working with a "parenting coach," who was to observe her interactions with her children.

Gordon also 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.

And he ordered the parents 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 became final in July.

Monday's order comes amid a career freefall for Spears, whose new album is due to be released November 13.

After her September 9 "comeback" performance on the MTV Video Music Awards, critics derided her singing and dancing as lackluster and said she appeared overweight in her sequined two-piece costume.

Her former divorce lawyer, Laura Wasser, resigned last month as her legal representative after telling reporters the singer "just wants to be a mom."

Spears' management company, the Firm, recently quit after representing the singer for little over a month. E-mail to a friend
Who did Kevin Federline take custody of? when were they divorced? Who divorced in July? When will Federline take custody of children? When were Federline and Spears divorced? When did the divorce take place? When did Spears and Federline get divorced? Who has cutody of Britney Spears kids? Who has custody of the children? When did the pair divorce? Who does Kevin Federline have children with? When were the pair divorced? What number of children do the couple have? when did pair divorced What number of children do Federline and Spears have? Who took custody of the children? What day is Federline taking custody of his children? when will federline take custody?
their two sons July. Spears and Federline Wednesday at noon. July. their July. Kevin Federline, Kevin Federline, July. Britney Spears, July. two July. two Kevin Federline, Wednesday Wednesday at noon.
question: Who did Kevin Federline take custody of?, answer: their two sons | question: when were they divorced?, answer: July. | question: Who divorced in July?, answer: Spears and Federline | question: When will Federline take custody of children?, answer: Wednesday at noon. | question: When were Federline and Spears divorced?, answer: July. | question: When did the divorce take place?, answer: their | question: When did Spears and Federline get divorced?, answer: July. | question: Who has cutody of Britney Spears kids?, answer: Kevin Federline, | question: Who has custody of the children?, answer: Kevin Federline, | question: When did the pair divorce?, answer: July. | question: Who does Kevin Federline have children with?, answer: Britney Spears, | question: When were the pair divorced?, answer: July. | question: What number of children do the couple have?, answer: two | question: when did pair divorced, answer: July. | question: What number of children do Federline and Spears have?, answer: two | question: Who took custody of the children?, answer: Kevin Federline, | question: What day is Federline taking custody of his children?, answer: Wednesday | question: when will federline take custody?, answer: Wednesday at noon.