A US judge has granted Britney Spears permission to spend one night a week with her young sons, 10 days after the singer lost full-time custody.
Britney Spears was at the court hearing in Los Angeles on Thursday
The court had granted custody of the two boys to Spears' ex-husband Kevin Federline and banned overnight visits.
Mr Federline's lawyer said he had agreed to the terms, provided there were "assurances in place that made him feel the kids were protected".
Ms Spears has asked the Los Angeles court if her mother can monitor visits.
As the singer arrived at the courthouse on Thursday, she said: "I'm doing good."
Superior Court Commissioner Scott Gordon allowed the star to keep her sunglasses on, saying he understood she had a "medical condition".
Reporters were then asked to leave as the hearing continued behind closed doors.
Ms Spears' attorney Anne Kiley said it was important that the pop star had overnight access to her sons, two-year-old Sean Preston and Jayden James, aged one.
"I do think it is an emergency for them not to have overnights with their mother, which they've always had," she said.
"What possible concern can he [Federline] have if there are monitors present?"
Federline won full-time custody of the children earlier this month
Ms Spears and Mr Federline must appear at a further hearing on 26 October.
Last month, a judge said Ms 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.
But she later lost custody after failing to produce her driving licence and missing a test for drugs and alcohol.
Meanwhile, Ms Spears' music label is suing celebrity blogger Perez Hilton for posting recordings from her new album on his website without permission.
Jive Records brought the release of Blackout forward by two weeks because some tracks had been leaked online.
The company is seeking monetary damages and a court order barring further infringement by the site, written by Mario Lavandeira.
Mr Lavandeira's solictor said he would be "vigorously defended" in any action.