Kevin Federline is “awarded sole legal custody and sole physical custody of the minor children,” court Commissioner Scott Gordon said in a written ruling after an emergency hearing.
Gordon said Spears’s “visitation with the minor children is suspended pending further order of the court.”
The order is in effect until Jan. 14.
After the 40-minute hearing, Federline’s attorney Mark Vincent Kaplan said: “There are no winners here.”
He said he was “not happy about any of the events that have happened.”
Police responded to Spears’s house on Thursday night after she refused to turn over the boys to Federline’s bodyguard after a visitation day. Kaplan arrived at the house “to bring a document … that identified the existing court order” about custody, he earlier told the Associated Press.
“I was up at the guard gate where (she) lives,” he told AP. “I did not go in” to the home.
On Friday, Kaplan and Spears’s attorney met privately with the judge in his chambers, then returned in the afternoon for a closed hearing.
Spears, meanwhile, is not facing any criminal charges – for now.
“The LAPD is not planning to file any charges against Ms. Spears at this time,” Officer April Harding tells PEOPLE. “The investigation is ongoing.”