NEW YORK — Kesha's plea to get out of her exclusive contract with music producer Dr. Luke, who she claims sexually and physically abused her for years, was denied by a New York judge Friday, prompting the pop star to break down in tears.

Manhattan Supreme Court Judge Shirley Werner Kornreich said releasing Kesha from the contract under Sony would cause irreparable harm since the "Tik Tok" singer would no longer have to fulfill her contractual obligation to make six more albums with Dr. Luke for the record label.

While attorneys for Dr. Luke and Sony argued Kesha Rose Sebert is bound by the contract and must perform her obligations or be held accountable, the record label did tell the court the singer will be allowed to work with another producer.

Still, it was a blow to Kesha’s year-and-a-half legal battle, which has become muddled with lawsuits and countersuits in two states.

Dr. Luke's attorney, Christine Lepera, said in a statement to BuzzFeed News that they were pleased with the court's decision fully denying Kesha's motion for a preliminary injunction.

"As the court recognized, Ms. Sebert has always had the ability to proceed with her career if she so chooses," Lepera said. "We remain confident that when all the facts are presented that Ms. Sebert’s allegations against Luke will be shown to be completely false and were asserted solely to extort money and gain contractual leverage."

Kesha has been battling to get out of her contract with Lukasz Gottwald, aka Dr. Luke, since suing him on Oct. 14, 2014, in California, claiming sexual assault and battery, sexual harassment, gender violence, unfair business practices, and infliction of emotional distress.

Almost simultaneously, Dr. Luke filed his own lawsuit against Kesha in New York for breach of contract and defamation. Then in June 2015, Kesha’s California case was put on hold by a judge after ruling that the New York case took precedent.

Kesha's lawyers claimed that the singer could no longer work with Dr. Luke out of fear for her physical safety, citing "heinous acts of abuse." In asking the court for relief in November, Kesha argued that if she isn't released from Dr. Luke’s exclusive contract, she will continue to be unable to record, write, publish, or perform music with anyone else. And if that continues, the singer claims her career will effectively be over.

Kesha's attorney, Mark Geragos, also argued Friday that Sony's pledge that she can work with another producer can't be trusted because the record label is setting her up for failure. Geragos also claimed Sony will not promote her work because the label's interest lies in protecting Dr. Luke.

Richard Shotwell / AP

Lukasz Gottwald aka Dr. Luke

"They're going to pick him over her," he said.

Kornreich interrupted him, though, saying she would not presume a company like Sony would not want to make money off its investment.

"Our interest is in her success. Our interest is in Dr. Luke’s success," Sony's lawyer said. "They are not in the least bit mutually exclusive."

Kesha, clad in an all-white suit, audibly cried as the judge issued her decision. Outside the courtroom, her fans, covered in glitter and face paint, held up "Free Kesha" signs and sang her songs.

Longtime fans Michelle Martin and Mike Jenkins said they traveled to New York from Maine to support Kesha during her legal troubles.

"It's a huge disappointment," Martin told BuzzFeed News outside the courthouse. "This is just a short battle in a war we're not done fighting."

Complicating the legal mess, Kesha countersued Dr. Luke in New York in July 2015, again citing a history of abuse. In her court filings, Kesha said she was 18 when Dr. Luke convinced her to drop out of high school, leave her family, and move to Los Angeles to pursue a music career.

Over the next 10 years, she claims Dr. Luke abused her sexually, physically, and emotionally to the point that she nearly lost her life. Dr. Luke dished out the abuse, Kesha claims, in order to completely destroy her self-confidence and maintain complete control over her life and career.

Dr. Luke's lawyers also sought to have Kesha’s counterclaims dismissed, but the judge postponed making a decision, saying Kesha's lawyers had not provided enough details, such as exact date and location of the alleged assaults.

Kesha has claimed Dr. Luke continuously made sexual advances toward her and “forced” her to take drugs and alcohol in order to take advantage of her sexually.

She also alleges that on another occasion Dr. Luke gave her "sober pills," but she woke up the following afternoon naked in his bed sore, sick, and with no memory of how she got there — the alleged result of ingesting a date rape drug.

In 2014, she spent two months in a rehab facility where according to her lawsuit doctors told her Dr. Luke had physically and psychologically damaged her.

Dr. Luke's legal team said Kesha’s claims "are nothing more than smoke and mirrors" and that Kesha's attorneys have spent all their time and effort trying to destroy their client's reputation in the hope that he'll concede.