Image copyright Getty Images Image caption Kesha recently released her fourth album, High Road, while still under contract to Dr Luke's label, Kemosabe

Lukasz Gottwald, the music producer better known as Dr Luke, has won several pre-trial arguments in his defamation case against pop star Kesha.

Gottwald sued Kesha in 2014, saying she had fabricated rape claims against him to get out of a recording contract.

In a ruling on Thursday, New York judge Jennifer Schecter said the star had defamed Gottwald when she texted Lady Gaga claiming he had raped Katy Perry.

Kesha was also told to pay interest of $373,671 (£289,000) on late royalties.

Image copyright Getty Images Image caption Dr Luke has written and produced hits for Rihanna, Pink, Britney Spears and Kelly Clarkson, amongst others

The pop star, whose full name is Kesha Rose Sebert, rose to fame in 2009 with Dr Luke-produced hits like Tik Tok and We R Who We R.

But she sued him in 2014, seeking to void their contract because, her lawyers claimed, he had "sexually, physically, verbally, and emotionally abused [Kesha] to the point where [she] nearly lost her life".

The allegations of abuse included two instances in which Kesha claimed Gottwald had drugged and raped her.

He denied the "false and shocking accusations" and counter-sued for defamation and breach of contract.

The bitter legal dispute has dragged on ever since. At every point, Kesha has either dropped her claims or lost in court, where matters of assault are difficult to prove.

'No evidence' for Katy Perry claim

Thursday's ruling (which you can read online) was another setback, with judge Schecter dismissing a number of Kesha's defence arguments.

Most importantly, she made it easier for Gottwald's laywers to prove defamation by ruling that the producer was not a public figure or household name at the time of Kesha's allegations becoming public.

Individuals who are less well-known to the general public only have to prove that the defendant caused harm by making false claims, whereas public figures need to provide evidence of "actual malice" or "gross irresponsibility".

Image copyright Getty Images Image caption Kesha with Dr Luke at the 2011 ASCAP Awards, where he won songwriter of the year for hits including Tik Tok and Katy Perry's Teenage Dream

The judge made it clear she was not ruling on the factual question of whether Gottwald raped Kesha, saying that decision would be left to a jury.

A jury will also have to decide whether the accusations made in Kesha's original court case were made "in good faith of or as a sham to defame Gottwald and obtain business leverage".

However, the court also ruled that Gottwald had already "met the heavy burden" of establishing defamation in one specific instance - Kesha's 2016 text message to Lady Gaga, in which she said Katy Perry had been "raped by the same man".

"Perry unequivocally testified that Gottwald did not do so," wrote judge Schecter. "There is no evidence whatsoever that Gottwald raped Katy Perry or that Katy Perry, whose sworn testimony is unrefuted, must not be believed."

In addition, the court dismissed Kesha's claim that her contract with Dr Luke's record label, Kemosabe, was unconscionable and fraudulent.

Kesha's new legal team responded to the judge's decisions by saying, "We disagree with the Court's rulings. We plan to immediately appeal".

Gottwald's lawyer said her client was looking forward to clearing his name at trial.

"Kesha abandoned her meritless case against Dr Luke more than three years ago," said Christine Lepera in a statement.

"The only remaining lawsuit is Dr Luke's case against Kesha for defamation and breach of contract. 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.

"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," she concluded.

Follow us on Facebook, or on Twitter @BBCNewsEnts. If you have a story suggestion email entertainment.news@bbc.co.uk.