Stormy Daniel's defamation lawsuit against President Donald Trump has been thrown out – and the porn star is liable for his legal fees.
Daniels, real name Stephanie Clifford, sued the president in April after he said her drawing of a man she claimed threatened her in 2011 to keep quiet about her alleged affair with Mr Trump was a "con job".
Mr Trump tweeted that the man was "nonexistent" and Ms Daniels was playing the "fake news media for fools".
He retweeted a photo comparing the sketch she drew of the man with a photo of her husband.
A sketch years later about a nonexistent man. A total con job, playing the Fake News Media for Fools (but they know it)! https://t.co/9Is7mHBFda
— Donald J. Trump (@realDonaldTrump) April 18, 2018
US District Judge S James Otero said Mr Trump's comment, which he called "rhetorical hyperbole", was protected speech under the First Amendment.
Under the ruling Mr Trump is also entitled to collect lawyers' fees from Ms Daniels, however the amount will be determined later.
"If this court were to prevent Mr Trump from engaging in this type of 'rhetorical hyperbole' against a political adversary, it would significantly hamper the office of the president," the judge wrote.
"Any strongly worded response by a president to another politician or public figure could constitute an action for defamation.
"This would deprive this country of the 'discourse' common to the political process."
Ms Daniels' lawyer, Michael Avenatti, said he would appeal the decision and he was confident it would be reversed.
"There is something really rich in Trump relying on the First Amendment to justify defaming a woman," he said.
However, Mr Trump's lawyer, Charles Harder, said: "No amount of spin or commentary by Stormy Daniels or her lawyer, Mr Avenatti, can truthfully characterise today's ruling in any way other than total victory for President Trump and total defeat for Stormy Daniels."
The defamation case is separate from another ongoing lawsuit that Ms Daniels filed against Mr Trump.
Ms Daniels is suing to dissolve a nondisclosure agreement signed days before the 2016 election, for which she was paid $130,000 (£98,789).
She claims the agreement should be invalidated because Mr Trump's personal lawyer, Michael Cohen, signed it, but the president did not.
Lawyers for Mr Trump and Cohen now say the deal which paid her to keep quiet was invalid and they will not sue her for breaking it.
Mr Trump's lawyer said the president never considered himself as party to the agreement and does not dispute Ms Daniels' claim that the contract is not valid.
More from Donald Trump
However, Ms Daniels' lawyer does not want the case thrown out.
Cohen admitted in August to campaign finance violations in which he coordinated with Mr Trump on a hush-money scheme to buy the silence of Ms Daniels and a Playboy model who also claims she had an affair with Mr Trump.