Singer Britney Spears must be monitored when she visits her two children, a court in Los Angeles has decided.
Spears is at number one in the US Billboard "hot digital songs" chart
Her time with her sons will be halted if her behaviour "endangers" the youngsters, according to the ruling.
The star's ex-husband, Kevin Federline, was awarded custody after Spears failed to produce her driving licence and missed a test for drugs and alcohol.
Spears is likely to see her children every other day but must also attend three counselling sessions this month.
Her son Sean Preston is two years old, while his younger brother, Jayden James, is one.
Last month, a judge said Spears, 25, showed "a habitual, frequent and continuous use of controlled substances and alcohol".
She was then ordered to complete random drug and alcohol tests twice a week, as well as meeting weekly with a "parenting coach", according to court documents.
The judge told Spears and Federline to complete a parenting class too.
Britney Spears and Kevin Federline separated 11 months ago
Also last month, Ms Spears was charged with hit-and-run and driving without a valid licence.
She was accused of hitting a parked car and driving away from the scene in Los Angeles 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 after her separation from Mr Federline last November.
She was dropped by her management firm last month after her comeback performance at the MTV Video Music Awards was panned by critics.
However, her new single - Gimme More - has topped Billboard's "hot digital songs" chart in the US, and has jumped 60 places to number three on the Billboard singles chart.
Her new album is due to be released on 12 November in the UK and the following day in the US.