Britney Spears has lost physical custody of her sons.
Los Angeles County judge Scott Gordon ruled that Sean Preston and Jayden James' father Kevin Federline will retain full custody from 3 October.
The news comes after Federline's lawyer, Mark Vincent Kaplan, presented his client's case in Los Angeles Superior Court on Monday morning.
Reports suggest Kaplan raised concerns about Spears' qualities as a mother after she was spotted driving without a license over the weekend while her children were in the car.
Insiders claim Kaplan also brought up Spears' driving without a license charge from August 6, 2007, when she was involved in an alleged hit-and-run motoring offence after crashing into a parked car in the San Fernando Valley.
The emergency hearing lasted an hour and took place behind closed doors.
The shocking outcome follows two weeks of bizarre Spears behaviour, which includes sightings of the pop singer partying and sobbing in the street, and an incident where she invited a member of the paparazzi to join her in a sandwich shop toilet in Los Angeles.
Judge Gordon initially ruled the couple would continue to share custody for the duration of their new court battle.
Meanwhile, Spears could face more legal trouble if she fails a court-ordered, random drug test, administered twice weekly.