Adult film star Stormy Daniels must pay President Trump $293,000 in legal fees, a judge ruled on Tuesday.

"The U.S. District Court today ordered Stormy Daniels (real name Stephanie Clifford) to pay President Trump $292,052.33 to reimburse his attorneys’ fees (75% of his total legal bill), plus an additional $1,000 in sanctions to punish Daniels for having filed a meritless lawsuit against the President designed to chill his free speech rights," Charles J. Harder, the president's legal counsel, said in a statement.

"The court’s order," Harder said, "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."

Attorneys for President Trump had asked a court earlier this month for nearly $800,000 in lawyers’ fees and penalties from Daniels for the failed defamation lawsuit against him. Harder defended more than 500 hours his firm spent that rang up a nearly $390,000 legal bill for the president and asked for an equal amount in sanctions as a deterrent against a “repeat filer or frivolous defamation cases.”

Daniels' lawyer Michael Avenatti quickly reacted, declaring the ruling wouldn't survive an appeal.

"Charles Harder and Trump deserve each other because they are both dishonest," Avenatti tweeted. "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?"

Daniels alleged she had a one-night affair with Trump in 2006. She sued him earlier this year seeking to break a non-disclosure agreement she signed days before the 2016 election about the alleged affair as part of a $130,000 hush money settlement. Trump has strongly denied the affair took place.

Despite the deal to stay quiet, Daniels spoke out publicly and alleged that five years after the alleged affair she was threatened to keep quiet by a man she did not recognize in a Las Vegas parking lot. She also released a composite sketch of the mystery man.

She sued Trump for defamation after he responded to the allegation 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)!”

Daniels' lawsuit against Trump was tossed out of court in October, with U.S. District Judge S. James Otero citing free-speech grounds.

"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 U.S.,” Otero said at the time. “The First Amendment protects this type of rhetorical statement.”

“The ruling also states that the President is entitled to an award of his attorneys’ fees against Stormy Daniels,” Harder said in a statement to Fox News following the judge's order.