Kesha broke down in court as she lost her case to nullify her contract with Dr Luke and Sony records on Friday.

The 28-year-old has been battling with the record label and producer for the last three years and was inconsolable when her request for a preliminary injunction - that would have given her a temporary break from her contract - was denied by a judge in Manhattan Supreme Court.

The singer wanted to nullify her six album deal with Sony Records after accusing the producer - real name Luke Gottwald - of raping her when she was 18-year-old, but a judge turned down the request claiming it would undermine the state’s laws governing contracts.

Kesha weeps in court (Image: New York Daily News / Getty)

The star leaves court on Friday with her family (Image: Raymond Hall/GC Images)

Kesha's lawsuit against Dr Luke was first filed in October 2014, but relations between the pair had broken down long before that.

The singer moved to Los Angeles at age18 after signing a recording contract with Dr Luke and Kemosabe Entertainment in 2005 and in 2009 a multi-album deal with RCA Records through Dr Luke.

Read more:

Dr Luke has been accused of abusing the singer (Image: FilmMagic)

After the release of her 2010 album Animal she was heard praising the producer in an interview with Billboard: "He really lets me be myself. All the crazy sh** I say, he embraces, because he really embraced my personality.

"A lot of producers have tried to tone it down. And I wouldn't be as successful as I have been had I been watered down."

Kesha covers Billboard (Image: Splash)

Three years later though and things had changed.

In September 2013 Kesha fan Rebecca Pimmel set up a "free" Kesha petition after accusing Dr Luke of "stunting" her growth as an artist. This came at the same time as her TV documentary My Crazy Beautiful Life, which saw Luke serve as an executive producer, aired.

It followed the production of her second album Warrior - released in November 2012 - and implied she had little creative control over the record.

Kesha’s lawyer, Mark Geragos claimed: "This lawsuit is a wholehearted effort by Kesha to regain control of her music career and her personal freedom after suffering for ten years as a victim of mental manipulation, emotional abuse and an instance of sexual assault at the hands of Dr. Luke."

In the lawsuit, Kesha alleges that she was forced to use drugs as well as alcohol and found herself in situations where she had no memory.

As well as the instance of sexual abuse, there was also physical abuse and on one incident at his home in Malibu, he was “violently thrashing his arms at her”.

In the legal documents, Dr Luke’s lawyer Christine Lepera alleges Kesha and her mother Pebe Sebert had used “defamatory statements in an attempt to extort Gottwald into releasing Kesha from her exclusive recording agreement”.

The deposition taken in 2011 was previously sealed, but was released by the judge to be used in case at the request of Dr Luke’s lawyer, Christine Lepera.

Ke$ha allegedly denied having a sexual relationship with her producer (Image: Getty)

In the deposition, Kesha swears that Dr Luke did not give her a drug that knocked her out.

When asked if she knew what “a roofie” was, Kesha responded she did: “It's like a date rape drug.”

In December 2014 Kesha's mum counter-sued Dr Luke after he brought a lawsuit against her for defamation.

She claimed to have suffered emotional stress and post-traumatic stress after Luke allegedly raped her daughter in a way "as not to be tolerated in a civilized society."

She also alleged the record executive acquired the name 'Dr' because he used to deal drugs to celebrities when he worked as a guitarist on SNL for 10 years, and claims he boasted about taking girls out, getting them drunk and having sex with them.