A New York judge did not rule in Kesha's favor on Friday when she requested to end her recording contract.

The 28-year-old pop star was asking for a preliminary injunction that would allow her to get out of her record contract with Kemosabe Records, which is part of Sony Music. The request comes after Kesha's allegations that the 42-year-old songwriter/producer, Dr. Luke (Lukasz Gottwald), both drugged and raped her over a decade ago and consistently abused her both physically and emotionally. Dr. Luke has denied any wrongdoing.

In court, Kesha's attorney, Mark Geragos, argued that it was Dr. Luke's "end game to destroy her."

Get Breaking News Delivered to Your Inbox

"I don't understand what her problem is," New York Supreme Court Justice Shirley Kornreich said. "They are setting her up to fail," Geragos responded.

"It's not in Sony's best interest to make no money," the judge argued. "Are you really saying they are not going to promote her [music]?"

Geragos said doubted Sony was "going to promote Kesha, who claims to have been sexually harassed by Dr. Luke, their hitmaker."

Despite the arguments made by Kesha's lawyer, Kornreich would not "decimate a contract that was heavily negotiated."

Kesha, who was dressed in all white, started sobbing when she heard the decision. She was seated in the back of the courtroom with her boyfriend, Brad Ashenfelter, and mother, Pebe Sebert. The two consoled her as she began to break down.

"There has been no showing of irreparable harm," the judge said. "She's being given opportunity to record."

The decision came down after Dr. Luke and Sony's attorneys, led by Christine Lepera, claimed they had invested greatly into Kesha's career and had agreed to let her to record without him. "She was highly successful with her first album," their legal team argued. "Sony would like nothing more to see [Kesha record another album]."

At one point, Kesha tearfully left the courtroom with her bodyguard, followed by her mother.

The judge also, on multiple occasions, stated that she wasn't seeing enough evidence to corroborate Kesha's claims of abuse and sexual assault. "What disturbs me is the lack of facts," Kornreich said.

The judge opted not to rule on a motion to dismiss counterclaims until Kesha's lawyers filed with more information, specifically the times and places where these alleged instances of abuse occurred.

Meanwhile, a group of Kesha's glitter-clad fans were outside the courtroom protesting on behalf of the pop star. When she exited the courtroom, Kesha -- wearing a large pair of sunglasses -- hugged a few of her crying admirers and thanked them for being there.

"We love the fans more than anything," the singer's mother told ET. "I can't say anything else without getting into trouble."

Meanwhile, artist Lily Allen offered her support for Kesha on Twitter writing, "My thoughts are with @KeshaRose today. I'm sorry you've had to endure this experience."

My thoughts are with @KeshaRose today. I'm sorry you've had to endure this experience. — lily (@lilyallen) February 19, 2016

Reporting by Elizabeth VanMetre