Adult film actress Stormy Daniels attends the opening of the adult entertainment fair 'Venus' in Berlin, Germany, Oct. 11, 2018. Credit: Markus Schreiber | AP

A federal judge ruled Tuesday that Stormy Daniels must pay President Donald Trump more than $293,000 in legal fees in her failed defamation lawsuit, a decision that the president’s team hailed as a “total victory” but that Daniels’ attorney vowed would “never hold up on appeal.”

U.S. District Judge James Otero ruled that Daniels must pay Trump $293,052.33 in “attorneys’ fees, costs and sanctions,” a figure representing 75 percent of the amount Trump had been seeking.

Daniels had claimed in the lawsuit that Trump defamed her when he suggested she lied about being threatened to keep quiet about their alleged past relationship. Otero dismissed the suit in October, ruling that Trump’s “rhetorical hyperbole” was political in nature and ordering Daniels, whose given name is Stephanie Clifford, to pay the president’s legal fees.

[Stormy Daniels, hailed as ‘hero,’ cashes in on Trump scandal in Portland]

Daniels’ attorney, Michael Avenatti, has appealed Otero’s ruling.

The lawsuit is one of two that Daniels has filed against Trump. The second seeks to invalidate a 2016 nondisclosure agreement aimed at preventing Daniels from speaking about the affair that she says she had with Trump a decade ago. Trump denies that the alleged affair took place.

Charles Harder, an attorney for Trump, hailed Tuesday’s decision as a triumph for the president.

“The court’s order, along with the court’s prior order dismissing Stormy Daniels’ defamation case against the President, together constitute a total victory for the President, and a total defeat for Stormy Daniels in this case,” he said in a statement.

Avenatti disputed that interpretation, firing back with a tweet claiming that Harder and Trump “deserve each other because they are both dishonest.”

“If Stormy has to pay $300k to Trump in the defamation case (which will never hold up on appeal) and Trump has to pay Stormy $1,500,000 in the NDA case (net $1,200,000 to Stormy), how is this a Trump win?” Avenatti said in the tweet.

While Daniels must reimburse Trump for most of his legal fees, Otero wrote Tuesday that he did not award the president the full amount he was seeking because the hours charged by his attorneys were “excessive.”

“Ultimately, Defendant’s counsel did not need to spend as much time as they did conducting legal research and compiling factual exhibits that would not properly be before this Court,” Otero wrote.

He cited as one example of the “extraneous evidence” submitted by Trump’s attorneys “a detailed list of Plaintiff’s movie history and filmography, which was unnecessary to this Court’s decision-making.”

The Washington Post’s Elise Viebeck contributed to this report.