A court in the US state of California has refused to restore custody of her two children to singer Britney Spears.
Ms Spears and her former husband had been sharing custody
Instead, Ms Spears was granted rights to visit the children. Her former husband, Kevin Federline, was awarded sole custody earlier this week.
Los Angeles Superior Court commissioner Scott Gordon extended that custody order until another hearing on 26 October to review the situation.
The couple previously shared custody, and no reason was given for the change.
However, a lawyer for Ms Spears, Sorrell Trope, told a US magazine that the judge had acted after the singer was unable to prove she had complied with several court orders.
Last month, Mr Gordon said Ms Spears, 25, showed "a habitual, frequent and continuous use of controlled substances and alcohol".
The singer, whose career has been hit by a year of frequent erratic behaviour, did not attend court on Wednesday, although Mr Federline did.
Speaking after the hearing, Mr Federline's lawyer, Mark Kaplan, said his client believed the ruling giving him custody was "justified".
"Kevin wants to maintain the custody that he has as long as he can," Mr Kaplan added.
The judge was later expected to confirm the details of Ms Spears' visitation rights.
She has already been ordered her to undergo random drug and alcohol tests twice a week and meet weekly with a "parenting coach", according to court documents.
The judge has also ordered Ms Spears and Mr Federline to complete a parenting class.
Also last month, Ms Spears was charged with hit-and-run and driving without a valid licence.
She is accused of hitting a parked car and driving away from a Los Angeles car park on 6 August, a spokesman for the city's attorney's office said.
Ms Spears could face six months in jail and a $1,000 (£495) fine if convicted of the charges.
The singer's latest setback follows a year of unfavourable headlines following her separation from Mr Federline last November.
She was dropped by her management firm last month following her so-called comeback performance at the MTV Video Music Awards, which was panned by critics.
Her divorce was finalised on 30 July and since then, the estranged couple have shared an equal amount of time with the two boys.
However, Mr Federline had been fighting for greater time and more money.