A former X Factor judge claims that Britney Spears "wasn't there mentally" when she was a judge for the show.

X Factor UK judge Louis Walsh spoke about his time working with the "Toxic" singer to The Irish IndependentWalsh filled in for Simon Cowell during the Kansas City auditions when Cowell was home with bronchitis at the time.

“I was sitting with Britney for two days, and after every few auditions, she would go…” Walsh told the outlet, imitating Spears slumping over the judges' table.

“They would literally have to stop the show and take her out because she was on so much medication and other stuff. I felt sorry for her," he alleged.

“Here she was, the biggest pop star on the planet, and she was just sitting there physically, but she wasn’t there mentally,” Walsh added. “She had a lot of problems.”

The reporter asked Walsh if she should have been judging at the time or getting help.

“She was getting millions of dollars to do it, so why the f--k wouldn’t she sit there?” he responded.

Spears appeared as a judge on Season 2 of the U.S. version of X Factor in 2012 alongside Cowell, Demi Lovato and LA Reid. For the one season, Spears reportedly earned $15 million.

Spears later shared that she didn't enjoy some of her time on the reality singing competition. She did not want to critique contestants and had anxiety over making the decisions and comments to contestants.

“I was having panic attack after panic attack,” she told Elle after the show's run. “I got over that quickly, though, and realized that I was helping them by being honest." She later added that she wanted to be protective of the younger contestants' hopes and dreams.

Celebrities Who Opened Up About Mental Health

More From 92.9 NiN