After years of intense public scrutiny, Kesha made the brave decision to talk openly about her eating disorder at this year's South by Southwest (SXSW) festival.

During a panel co-hosted by Refinery29, Kesha revealed that she 'almost died' from an eating disorder.

Kesha eating disorder
photo: Splash News

Kesha shared the heartbreaking details about her eating disorder for an important reason:

"I want to talk about it because I want to help people,”  she explained. "It can kill you. I almost died."

Kesha said she came "very close" to dying from starvation.

"I came very close, closer than I ever knew," she confessed. "By the time I entered rehab they were surprised I hadn't had a stroke because I wasn't consuming enough of anything."

As her health declined, Kesha continued to starve herself because people kept telling her that her trimmer figure looked "great."

Kesha eating disorder
photo: Splash News

"I was starving and people used to say, 'Wow, you look so great. Keep doing what you're doing,'" Kesha recalled. "And little did they know they were encouraging me to starve myself to death."

Even though she was getting thinner, Kesha still faced extreme body-shaming from her former music producer, Lukasz "Dr. Luke" Gottwald.

Dr. Luke Kesha
photo: Wireimage

He famously called the singer a "fat fucking refrigerator."

Last month, the extent of Dr. Luke's abuse came to light after emails between the producer and Kesha's manager, Monica Cornia, were released publicly.

In their exchange, Dr. Luke criticized Kesha's body, claiming that the top songwriters and producers didn't want to work with her "because of her weight."

Dr. Luke forced Kesha to maintain a strict diet, spearheading her battle with bulimia and body dysmorphia.

In an email dated June 28, 2012, Dr. Luke noted that Kesha was on a juice cleanse — but she "broke" her fast by drinking a Diet Coke.

"There have been many times we have all witnessed her breaking her diet plan," Dr. Luke told Cornia. "This perticular [sic] time, it happened to be diet coke and turkey while on an all-juice fast."

But in 2014, Kesha finally got the help she needed.

She checked into rehab for her bulimia.

Kesha rehab
photo: Splash News

However, all of her problems didn't disappear when she stopped purging.

Kesha is still in an intense court battle against Dr. Luke over his alleged sexual assault and his refusal to release Kesha from his label. 

She also has trouble avoiding online abuse from internet trolls. 

"[The internet] is not a healthy place for me," she said during the SXSW panel. "I try to limit myself in terms of reading comments because there can be a million positive ones, but I always gravitate towards the one negative one. I hold on to that and I internalize it and I know it’s an unhealthy habit."

Although her struggles are far from over, Kesha said she's made tremendous growth as a person and is optimistic about the future.

"Over the past couple of years I feel like I’ve become a woman in a lot of ways because I’m kind of reclaiming my personal space, my body, my music, and my life," she concluded. "I’ve since realized I’ve found a lot of strength in my vulnerabilities."