The triumphant return of Kesha to the music scene and the top of the charts has been one of the more compelling celeb stories of 2017. However, on top of her much-publicised legal battles with her label and former producer, the star has also revealed how she conquered her eating disorder.

The 30 year old singer gave a new interview with Rolling Stone magazine, the same month that her new album Rainbow hit the top of the Billboard charts. In it, Kesha revealed that she has been battling an eating disorder – identifying that the exact moment she realised her condition was at a dinner party.

“And I was like, 'Oh, my God, what if they walk outside and see this food in a bush? Or they see it in the garbage can?' And I just had all this mounting anxiety,” she said, and realised that she couldn’t go on like that.

KeshaKesha revealed her battle with an eating disorder

“Finally I was like, 'F***. This. Sh***. F*** this. I'm hungry!' And I am so anxious that I feel like I'm going to explode from all the secrets. All the secret times I'm pretending to eat or other times I'm purging, and I'm trying to not let anybody know. And I'm just f***ing sick of this shit,” she continued.

“And I remember just shaking because I was so fed up, so anxious, and I was just mad that I had let myself get to that point.”

More: Kesha shows her strength with uplifting new single ‘Praying’

She immediately arranged to meet her mother at a gas station nearby, and admitted to her then that she had a problem. Soon after, she checked into rehab and worked with a nutritionist.

“I just remember crying into a carbohydrate,” Kesha remarked, “being like, 'I can't eat it. It's going to make me fat, and if I'm fat, I can't be a singer because pop stars can't eat food – they can't be fat’.”

This remark hinted at the details of her ongoing legal battle with Dr. Luke, her former producer whom she claims raped her several years ago. Court reports have reported allegations that he inflicted mental pressure on her to conform to a certain shape, using the phrase “fat f***ing refrigerator”. He denies these accusations.

“I really just thought I wasn't supposed to eat food,” she said later in the interview. “And then if I ever did, I felt very ashamed, and I would make myself throw up because I'd think, 'Oh, my God, I can't believe I actually did that horrible thing. I'm so ashamed of myself because I don't deserve to eat food.”

More: Watch Jerry Seinfeld brutally turn down Kesha for a hug. Three times.