Porn star Stormy Daniels, left, claims to have had an affair with President Donald Trump more than a decade ago -- and that his lawyer paid her hush money to keep quiet about the encounter

President Donald Trump scored his first major legal victory Monday against porn star Stormy Daniels, as a federal US judge rejected her defamation suit against him.

Daniels -- real name Stephanie Clifford -- still has a separate lawsuit against the president linked to $130,000 in hush money she was paid by Trump's lawyer shortly before the November 2016 presidential election to keep quiet about an alleged affair.

US District Judge S. James Otero in Los Angeles tossed out the defamation suit Daniels filed earlier this year after Trump claimed on Twitter that the adult film actress had invented threats to silencer her over her claims the pair slept together more than a decade ago.

"The Court agrees with Mr Trump's argument because the tweet in question constitutes 'rhetorical hyperbole' normally associated with politics and public discourse in the United States," Otero wrote in his ruling.

"The First Amendment (of the US Constitution) protects this type of rhetorical statement."

Daniels's lawyer Michael Avenatti vowed to appeal the decision.