Britney Spears lost custody of her children because she failed to produce a California driver's license and allegedly missed a drug and alcohol test, her lawyer said in a published report.

"We weren't able to prove compliance with what the judge ordered," attorney Sorrell Trope told People magazine.

"Specifically," he said, "the judge ordered that by 10 a.m. (Monday) morning, both parties show valid California driving licenses. I've been unable to produce evidence of that."

Trope said another factor was a claim by ex-husband Kevin Federline's attorney that Spears had skipped a test. "There's no evidence that she actually failed," the lawyer said.

Trope did not immediately return a call from The Associated Press seeking further comment.

On Monday, Superior Court Commissioner Scott M. Gordon ordered Spears to relinquish custody of her sons Sean Preston, 2, and Jayden James, 1, to Federline "until further order of the court."

The judge had previously ordered Spears to undergo random drug and alcohol testing twice a week and meet weekly with a "parenting coach" who was to observe and report back to the court. Both Spears and Federline must complete the court's "Parenting Without Conflict" class or receive private counseling, the court indicated.

The loss of her children was the latest problem to plague Spears, whose fortunes have taken a very public turn for the worse since splitting from Federline, 29, last year.

The two were married in October 2004. Spears filed for divorce last November and it became official in July.

Since becoming single, Spears has appeared increasingly erratic and out-of-control. First, she was photographed at various Hollywood hotspots partying hard with Paris Hilton, occasionally without panties. Then Spears shaved her head as paparazzi looked on, beat a car with an umbrella and ended up spending a month in rehab.

Spears was set to redeem herself and return to the pop throne with a much-hyped performance at the MTV Video Music Awards last month. But it was universally panned, with Spears appearing spaced-out, lethargic and relatively out of shape. The following week, her management firm dropped her and her divorce lawyer resigned.

Spears was then charged with misdemeanor counts of hit-and-run and driving without a valid license for allegedly crashing into a parked car in August.

The driving offenses likely compelled the judge to issue Monday's orders, said New York divorce lawyer Raoul Felder. Officials from the Department of Motor Vehicles said Spears applied for a California driver's license but did not complete the process.

"She was driving without a license with a child in the car," Felder said. "You can put aside the in and out of rehab, the shaving her head. But this? When a judge went out on a limb for her? There's no going back."

Though Spears must relinquish physical custody of the children until further ruling from the court, she and Federline still share legal custody.

Los Angeles divorce lawyer Connolly Oyler said he's surprised the children weren't taken from Spears sooner. Judges typically remove youngsters from households where parents are ordered to undergo drug testing, he said.

But, he added, all is not lost for Spears.

"If she picks a good counselor and gets a different set of friends, there's a good chance she can turn things around," he said, noting "she's only 25."

The couple is due back in court Oct. 3. Spears' new album is set to be released Nov. 13.