LOS ANGELES — A federal judge dismissed adult film star Stormy Daniels' defamation lawsuit against President Donald Trump on Monday, finding a tweet by Trump to be constitutionally protected speech.

Daniels, whose real name is Stephanie Clifford, has claimed that she had a sexual encounter with Trump in 2006 and was warned by an unidentified man to keep quiet about it five years later, after she gave an interview to a gossip magazine.

In April, she worked with a forensic artist to create a sketch of the man, who she said told her to leave Trump alone and suggested that something bad could happen to her.

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

In a ruling filed in U.S. District Court in Los Angeles, Judge James Otero found that the tweet "constitutes 'rhetorical hyperbole' normally associated with politics and public discourse in the United States."

"The First Amendment protects this type of rhetorical statement," Otero wrote. He said Trump was entitled to attorney's fees, which weren't specified.

Daniels will appeal the decision, said her attorney, Michael Avenatti.

He tweeted that Daniels' other claims against Trump and Michael Cohen, the president's former personal attorney, were unaffected.

Daniels has filed a separate suit against Trump and Cohen seeking to invalidate a non-disclosure agreement in which Cohen paid her $130,000 to remain silent about the alleged affair before the 2016 presidential election.

Attorneys for Trump and Cohen filed documents last month indicating that they don't intend to enforce the agreement. But Avenatti countered that he and his client want to go forward with that lawsuit anyway.

Trump has denied any affair with Daniels took place at all.

Charles Harder, an attorney for Trump, called Monday's ruling a "total victory," telling NBC News in a statement: "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."