A federal judge has dismissed a lawsuit against President Trump from adult film actress Stormy Daniels, who claimed the president had defamed her earlier this year on Twitter.

The lawsuit was filed over a tweet Trump sent in April suggesting Daniels was lying about being threatened in 2011 not to go public with her story of an alleged sexual encounter with Trump.

"A sketch years later about a nonexistent man. A total con job, playing the Fake News Media for Fools (but they know it)!"the president tweeted.

Daniels, whose real name is Stephanie Clifford, claims she had a sexual encounter with Trump in 2006. Trump has denied that ever happened, but did finally admit — after first denying it — to reimbursing his lawyer Michael Cohen for a $130,000 payment made to Daniels on the eve of the 2016 election.

This ruling does not pertain to legal action Daniels has pursued over a non-disclosure agreement she entered into about the alleged sexual encounter.

In the ruling, U.S. District Judge James Otero said the tweet "constitutes 'rhetorical hyperbole' normally associated with politics and public discourse in the United States" that is protected by the First Amendment.

"Mr. Trump's tweet displays an incredulous tone, suggesting that the content of his tweet was not meant to be understood as a literal statement about the plaintiff," the ruling also states. It also calls the lawsuit a "fishing expedition" and finds that Daniels has failed to show that Trump "acted with actual malice or reckless disregard for the truth."

The judge also ruled that the president is entitled to "reasonable" attorney's fees.

Daniels' lawyer Michael Avenatti has pledged to appeal and notes that "other claims against Trump and Cohen proceed unaffected."

"Trump's contrary claims are as deceptive as his claims about the inauguration attendance," Avenatti tweeted Monday night.

Trump attorney Charles Harder countered in a statement that, "No amount of spin or commentary by Stormy Daniels or her lawyer, Mr. Avenatti, can truthfully characterize today's ruling in any way other than total victory for President Trump and total defeat for Stormy Daniels."

Copyright 2018 NPR. To see more, visit http://www.npr.org/.