A judge on Wednesday refused a plea by US singer Kesha to free her from a contract with an allegedly abusive producer, in a case that has galvanized feminists.

Kesha had asked a court to suspend her exclusive contract with Dr. Luke's Kemosabe Records, part of the Sony Music conglomerate, saying that the producer raped her and tormented her emotionally.

But a New York judge dismissed her lawsuit on largely technical grounds, ruling in one count that Kesha could not seize on the city's laws against hate crimes.

Kesha failed to prove that Dr. Luke "harbored animus toward women or was motivated by gender animus when he allegedly behaved violently toward Kesha," Judge Shirley Kornreich wrote.

READ: Singer Kesha urges women to speak out amid abuse suit

"Every rape is not a gender-motivated hate crime," she wrote.

The lawsuit did not ask the court to look into the substance of the assault allegations. Kesha said that Dr. Luke, whose real name is Lukasz Gottwald, drugged and raped her in 2005 and 2008.

The 29-year-old singer, whose full name is Kesha Rose Sebert, did not press charges at the time and said in the lawsuit that Dr. Luke threatened to destroy her career if she went public.

But the judge said the court did not have jurisdiction, with Kesha living in California and entering the contract with the New York-based label after the alleged violence occurred.

"Kesha failed to plead that any of the alleged discrimination occurred in New York State or City," the judge wrote, adding that the statute of limitations had likely passed in any case on rape charges.

The decision deals a major blow to Kesha although she had also filed suit in California.

Kesha has enjoyed an outpouring of support after the New York court in February refused to issue an initial injunction on the contract.

Adele and Taylor Swift, two of the top women in music, have both publicly backed Kesha and feminist protesters have rallied outside Sony Music's New York headquarters.

Dr. Luke -- who has worked with stars including Katy Perry -- has denied the allegations and filed a counter-suit accusing Kesha of making false claims to get out of the contract.

Kesha recently said that she was offered a settlement in which she would "lie" and apologize for saying she was raped.

"I will not take back the truth. I would rather let the truth ruin my career than lie for a monster ever again," she wrote on Instagram.

Kesha's 2009 debut album, "Animal," went to number one on the US chart and generated the major hit "Tik Tok," co-written with Dr. Luke.