Less than a week after Kesha released her latest album, the pop star received bad news in her legal battle with the music producer she accused of sexual assault.

In 2014, Kesha, whose full name is Kesha Rose Sebert, sued her producer over verbal abuse and an alleged sexual assault. He countersued the singer for defamation.

On Thursday, the dispute took a turn as a New York judge delivered a powerful blow to the 32-year-old musician, who recently released “High Road” to glowing reviews for its party anthems.

New York Supreme Court Judge Jennifer G. Schecter ruled that Kesha had defamed her producer, Lukasz “Dr. Luke” Gottwald, in a private text message to Lady Gaga. The 2016 text said Kesha and fellow pop star Katy Perry had been raped by “the same man," referring to Gottwald. Perry later testified in a deposition that she had never been raped by Gottwald. Even though the false statement appeared only in a private text, the judge still ruled it defamatory.

“There is no evidence whatsoever that Gottwald raped Katy Perry or that Katy Perry, whose sworn testimony is unrefuted, must not be believed,” Schecter wrote in her decision Thursday. “Moreover, publication of a false statement to even one person, here Lady Gaga, is sufficient to impose liability.”

The decision resolved only a small part of the case. Kesha’s other allegations about 46-year-old Gottwald, including that he drugged her at a party in 2005 and sexually assaulted her, will be evaluated by a jury as the case moves forward.

“We disagree with the Court’s rulings,” Kesha’s legal team said in a statement to E! News in response to Thursday’s decision. “We plan to immediately appeal.”

Schecter also ruled Thursday that the “TiK ToK” singer owed her record label more than $373,000 in interest for unpaid royalties she withheld between 2012 and 2016.

“Dr. Luke looks forward to the trial of his case where he will prove that Kesha’s other false statements about him were equally false and defamatory,” Gottwald’s lawyer Christine Lepera told Rolling Stone Thursday.

Kesha’s allegations stem from an October 2005 birthday party at a Los Angeles nightclub, according to Schecter’s summary of the case. Kesha, who was 18 at the time, alleged that Gottwald gave her something he called a “sober pill,” which she believes was a date-rape drug. At an after-party, Kesha became ill “because of food poisoning, alcohol or a roofie,” Schecter wrote.

When Kesha was kicked out of the party, Gottwald took her to his hotel room. Kesha said she believes Gottwald raped her that night, although she could not remember the alleged assault, because “she felt ripped and sore and experienced the after effects of a roofie,” according to the judge’s summary of her allegations.

Gottwald has denied any sexual contact and said Kesha slept in the hotel bed while he spent the night on the couch. Schecter said a jury will eventually decide whether Kesha’s accusations were defamatory.

“Many facts related to the events of October 5 and 6, 2005, are disputed,” Schecter wrote in her ruling Thursday. “The court does not know what transpired between the parties and is not tasked with fact finding. That is solely the job of the jury.”

In 2014, Kesha filed a lawsuit in California accusing Gottwald of sexually assaulting her nine years earlier, and demeaning her appearance and weight with comments that contributed to an eating disorder, which landed the singer in a treatment program.

Gottwald countersued the same day, accusing Kesha of defaming him in an attempt to strong-arm the record label into releasing her from a contract she had signed shortly after turning 18. In his defamation suit, Gottwald alleges the singer fabricated her claims to pressure the producer and record label to release Kesha from the contract that obligated her to produce at least six albums with Kemosabe Records before seeking new employers.

The allegations sparked outrage among the pop star’s fans and other musicians.

Lady Gaga, Ariana Grande, Lorde and many other artists tweeted their support for Kesha as a hashtag, #FreeKesha, gained popularity on social media. Adele emotionally backed Kesha during her acceptance speech at the 2016 Brit Awards.

Kelly Clarkson, who had also worked with Gottwald in the past, was vocal about the difficult relationship she had with the music producer. She tweeted that she couldn’t “say anything nice” about Gottwald’s character. The “American Idol” winner also told a radio station she felt “blackmailed” by her label to work with Gottwald.

Pink, who last worked with Gottwald in 2006, also criticized the producer’s treatment of artists: “This is his karma and he earned it because he’s not a good person,” Pink told the New York Times in 2017.

Kesha dropped her California lawsuit against the producer in 2016, saying she wanted to focus on resuscitating her career. Gottwald’s legal team suggested the decision undercut the singer’s allegations.

“If Kesha is voluntarily dismissing her claims in the California case, it is because she has no chance of winning them,” Lepera said at the time.

And on at least one count, Gottwald scored a victory in a bitter back-and-forth that remains ongoing.