Kesha has won her first big battle in her ongoing case against producer Dr. Luke - a judge has ruled she can pursue a counterclaim against his defamation allegations.

The pop star has been battling the hitmaker over contracts and allegations of abuse and defamation for the past seven years, and he recently won a decision over a false claim of rape.

But now the judge in the case has ruled Lukasz 'Dr. Luke' Gottwald will have to prove by clear and convincing evidence actual malice on Kesha's part when and if the warring parties take their legal fight to court.

The singer will also be allowed to seek compensatory and punitive damages, plus attorneys' fees and costs, for the lengthy legal battle, according to The Hollywood Reporter.

New York Supreme Court Justice Jennifer Schecter made the decision on Wednesday.

The news comes 16 months after it was determined Kesha defamed Dr. Luke by publishing a false statement when she texted Lady Gaga and suggested he had raped Katy Perry. Perry testified that the incident never happened.

The judge's change of heart comes after lawmakers in New York state recently passed legislation intended to protect free speech from frivolous litigation. Private figures now have to demonstrate actual malice to prevail thanks to the anti-SLAPP statute.

Dr. Luke will now have to show the pop star, who alleges she was drugged before he raped her, had knowledge of falsity or recklessly disregarded the truth.

Responding to the judge allowing Kesha to advance her counterclaim, the singer's attorney Leah Godesky said, "As everyone knows from (the) beginning, this is a he-said-she-said case where the evidentiary burden matters."

The producer's lawyers said in a statement to the publication, "Today's court hearing was only about a technical legal issue: the burden of proof at trial. Dr. Luke would have filed this case regardless of the burden of proof. At trial, Dr. Luke will prove to the jury, as he has always maintained, that Kesha spread a vicious lie to get out of her contracts."