Kesha's ongoing legal battle with Dr. Luke just took a turn for the worst after being ordered to pay the music producer $374,000 for allegedly defaming him when she told Lady Gaga that he raped Katy Perry.

On February 6, a judge ruled against the "Tik Tok" hitmaker following the defamation case that Dr. Luke — whose real name is Lukasz Gottwald — brought against her in 2017 after she sued him for sexual assault in 2014.

According to court documents obtained by Pitchfork, Manhattan Supreme Court Justice Jennifer Schecter ruled that Kesha "made a false statement to Lady Gaga about Gottwald and that was defamatory."

The "defamatory" remarks refer to the text message the singer sent Gaga, which Dr. Luke claims was an attempt to strengthen her own accusations against him. In a deposition, Perry denied that she was ever raped by him.

"There is no evidence whatsoever that Gottwald raped Katy Perry. Moreover, publication of a false statement to even one person, here Lady Gaga, is sufficient to impose liability," the judge added.

Judge Schecter also ordered the 32-year-old pop star to pay the producer over $373,000 in interest because she was late in her payment of over $1.3 million in royalties. Kesha's counterclaim, which was a request to be released from a music contract with Dr. Luke's record company KMI, was also rejected.

"Dr. Luke is pursuing this lawsuit to seek recovery for the serious harm Kesha’s false accusations of rape have caused Dr. Luke, his family and his business," his lawyer said in a statement. "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."

It is now up to a jury to decide if Kesha did, in fact, defame Dr. Luke.