Comedian and "America's Got Talent" judge Howie Mandel was blunt about his struggles with anxiety and depression during an appearance on "The Joe Rogan Experience" this week.

Mandel surprised Rogan by revealing he wasn't happy, despite finding success, a great support system and taking medication. "I'm a f—ing mess," he confessed.

"When I hear about a person like you that doesn't feel well, that gets depressed, [I think] God da—it, when he's around people he seems so happy," the podcast host responded.

Mandel admitted that he found staying busy and talking to others kept him "distracted" from the negative emotions. But he struggled when he was alone.

photo of Howie Mandel

'AGT' judge Howie Mandel talked about his mental health struggles while on 'The Joe Rogan Experience.' (Photo source: Screenshot/The Joe Rogan Experience)

HOWIE MANDEL WEIGHS IN ON MENTAL HEALTH: ‘STIGMA STILL LIVES STRONGLY TODAY’

"The worst thing for me is quiet time. I don't like nighttime, I don't like when I get into my own head. That's why I like stand-up comedy," Mandel said. "Because in those moments you're just in the moment because you have to be."

Mandel said he was always on the precipice of going into a dark place in his mind. "If I veered off into the darkness that is me…I feel like I'm balancing on this little ledge all the time. These words and these interactions— are my cable that hold me on this side of it without falling off," he explained.

His candid comments surprised Rogan. "Wow, that's heavy," he replied.

Howie Mandel in sunglasses

Howie Mandel opened up about his struggles with depression on the ‘Joe Rogan Experience.’ (Getty Images)

HOWIE MANDEL OPENS UP ABOUT LIVING WITH OCD AND ANXIETY, SAYS COMEDY HELPS HIM COPE

Aside from comedy, medication and exercise also helped to keep him balanced.

Running for an hour a day on the treadmill acted as a form of meditation, he claimed. "It's good for my physical health but it's also better for my mental health," Mandel said. "And just staying crazy busy."

The comedian has previously spoken publicly about having obsessive-compulsive disorder (OCD). The condition is marked by having intrusive, unwanted thoughts that can manifest as phobias and lead to repetitive behavior or compulsions as well as anxiety, according to the Mayo Clinic

Last October ahead of National OCD Awareness Month, Mandel told Fox News Digital that there's a strong stigma in society attached to mental health problems that he's fighting to change.

Fox News' Maureen Mackey contributed to this report.

CLICK HERE TO GET THE FOX NEWS APP