Updated

Former Spice Girl member Mel B was ordered by a judge Tuesday to undergo random drug and alcohol testing as part of her bitter custody battle with ex-husband Stephen Belafonte.

Judge Mark Juhas ordered a “full-scale evaluation” of Mel B and Belafonte’s joint custody arrangement for their 7-year-old daughter Madison, Sky News reported.

Mel B, whose real name is Melanie Brown, will have to undergo random drug and alcohol testing for four months. The singer and Belafonte will also not be allowed to drink alcohol or take drugs at least eight hours before taking custody of their daughter.

In court papers filed Friday, Russell Updegraff, a former caretaker for Mel B’s children, claimed the singer put her children at risk because of her drinking habits. Mel B reportedly fired back and denied the claims.

The court appearance didn’t seem to faze the singer. Mel B returned to her hosting duties Tuesday evening on “America’s Got Talent” for the live semi-finals with fellow judges Howie Mandel, Heidi Klum and Simon Cowell.

MEL B IS ENTERING REHAB FOLLOWING PTSD DIAGNOSIS: 'I HAVE BEEN AT A CRISIS POINT'

The judge’s order on Tuesday comes after the singer told The Sun last month that she’s entering rehab following her post-traumatic stress disorder diagnosis that stemmed from her divorce. She later appeared on “The Ellen DeGeneres Show” to clarify her statement and explain why she’s planning to seek professional help.

"I've been in therapy since my father got diagnosed with cancer nine years ago," Mel B said on the show. "My therapy changed a little bit because I was in a very intense relationship, which you can all read about in my book."

She said she has PTSD, but denied being a sex addict and an alcoholic.

“You know, I was with the same person for 10 years and that was quite a turmoil, very intense. That's all I can say about it. I'd like to say a lot more, but we're on this show—let's keep it P.C.,” Mel B said. “But yeah, I address a lot of those issues [in the book] and I did kind of have to ease my pain...I do suffer a lot from PTSD.”