Photo credit: Splash News

Mel B threw a cup of water on Simon Cowell and stormed off “America’s Got Talent” after he made a joke about her wedding.

The trouble started when Cowell, 57, critiqued escape artist Demian Aditya’s performance during Tuesday’s show by saying, “I kind of think it will be like Mel B’s wedding night. A lot of anticipation, not much promise.”

Mel — who is currently going through a bitter divorce from her second husband Stephen Belafonte — was outraged and poured her mug of water all over Cowell before storming out.

Host Tyra Banks said, “Mel B is out. This is live TV, all. Live TV.” While judge Howie Mandel added, “Something just went wrong.”

Despite the drama, Mel, 43, eventually returned for the remainder of the show.

Mel filed for divorce from Belafonte earlier this year and was granted a restraining order against him after she accused him of abusing her, getting their nanny pregnant and forcing her to take part in threesomes.

The star has three daughters — 5-year-old Madison with Belafonte; Phoenix, 18, from her first marriage to Jimmy Gulzar; and Angel, 10, from a relationship with Eddie Murphy.

A judge recently ruled that Belafonte can apply for custody rights to his stepdaughter Angel after he argued he played a significant role in raising her and is keen to be able to retain contact with her in the future.

In a hearing in Los Angeles, Judge Riff said: “Mr. Belafonte claims it’s in the child’s best interests for him to have contact, frequent and continuing, with the child he says he raised from an infant.

“The petitioner says it is clearly not in that child’s interest. Those are the assertions.”

An insider said the 42-year-old producer — who has monitored visitation with Madison — was delighted with the ruling.