Stormy Daniels must pay $293,000 in attorney’s fees for her failed defamation case against President Trump, a federal judge has ruled.

The payout is less than half of the $800,000 in fees that Charles Harder, Trump’s lawyer, had requested at a hearing last week. Harder said he sought the sanctions to stop Daniels from bringing “frivolous” litigation in the future.

In a statement, Harder called the judge’s order “a total victory for the President, and a total defeat for Stormy Daniels in this case.”

Michael Avenatti, Daniels’ attorney, has vowed to appeal the ruling.

“No one’s going to be writing a check for one penny to Donald Trump or Michael Cohen,” Avenatti told The Daily Beast. Asked about Harder’s price tag, Avenatti added, “It’s ludicrous. The court shot him down.”

The ruling comes about two weeks after Daniels told The Daily Beast that Avenatti filed the defamation suit against her wishes and created a crowdfunding site without her permission. Within days, however, the porn star and her litigator seemed to be back in business after Daniels tweeted, “Pleased that Michael and I have sorted shit out…”

The lawsuit stems from Daniels’ claim that a goon threatened her in a Las Vegas parking lot in 2011 after she spoke to In Touch magazine about her alleged romp with Trump in Lake Tahoe five years before. “Leave Trump alone. Forget the story,” the mystery man allegedly warned, before gesturing at her infant daughter, “That's a beautiful little girl. It'd be a shame if something happened to her mom.”

Daniels released a forensic sketch of the alleged “thug” in April on ABC’s The View, soon after news of her “hush agreement” with Trump and his former fixer, Michael Cohen, swept the nation. In response, Trump called the drawing “a total con job” in a tweet that Daniels—born Stephanie Clifford—said was “false and defamatory” in court papers.

But U.S. District Court Judge S. James Otero disagreed. He tossed Daniels’ suit in October, calling the tweet “rhetorical hyperbole" protected under the First Amendment.

“To allow Plaintiff to proceed with her defamation action would, in effect, permit Plaintiff to make public allegations against the President without giving him the opportunity to respond. Such a holding would violate the First Amendment,” Otero ruled.

Harder, in one October motion, claimed Daniels filed the defamation suit “not because it had any merit, but instead for the ulterior purposes of raising her media profile.”

“This action is virtually unprecedented in American legal history,” Harder stated. “Plaintiff not only brought a meritless claim for defamation against the sitting President of the United States, but she also has engaged, along with her attorney, in massive national publicity relating to the case” that resulted in a book deal and national TV appearances.

In court papers, Harder claimed Trump’s legal team spent 509.25 hours defending the suit, resulting in $341,559.50 in attorney’s fees. He listed his own hourly rate as $841.64.

During the court hearing, Harder requested nearly $800,000 in legal fees and penalties.

Avenatti opposed Trump’s attorney’s fees in court papers, calling them “staggering and grossly inflated” for a case where “only two substantive motions were filed” and “no discovery was ever conducted.” The lawyer added, “In spite of this, Mr. Trump’s attorneys have somehow managed to spend an astonishing (and wasteful) 509.25 hours of attorney time litigating these issues over the span of six months.”

In his decision issued Tuesday, Judge Otero said Trump’s legal team “could have researched and briefed this case with less involvement from partners” and that “the descriptions of the work performed suggest that the hours spent on tasks by Defendant's attorneys were excessive.”

Otero also said that Trump’s lawyers “submitted significant extraneous evidence, including a detailed list of Plaintiff's movie history and filmography, which was unnecessary to this Court's decision-making.”

Meanwhile, Daniels is attempting to retreat from a defamation claim she filed against Cohen as part of her main lawsuit to invalidate her NDA.

Daniels accused Cohen of defamation after a public statement he issued in February as Daniels’ alleged affair with Trump—along with the $130,000 payout she received from Cohen ahead of the 2016 election—became a national controversy.

“Just because something isn’t true doesn’t mean that it can’t cause you harm or damage. I will always protect Mr. Trump,” Cohen said at the time.

In her amended complaint filed in March, Daniels said “it was reasonably understood Mr. Cohen meant to convey that Ms. Clifford is a liar, someone who should not be trusted, and that her claims about her relationship with Mr. Trump is ‘something [that] isn’t true.’”

“Mr. Cohen’s statement exposed Ms. Clifford to hatred, contempt, ridicule, and shame and discouraged others from associating or dealing with her,” the complaint added.

Yet early last month, Avenatti filed a motion seeking to amend Daniels’ complaint to omit the defamation claim against Cohen, whose lawyers have opposed this maneuver.

“While Plaintiff has failed to articulate the reason why she now seeks (after seven months) to drop her defamation claim, there is only one logical conclusion,” Brent Blakely, Cohen’s attorney, stated in court papers. “Plaintiff just lost a similar motion brought by Donald Trump and now seeks to escape the same result in connection her claim against Mr. Cohen.”

As The Daily Beast reported, Avenatti has claimed that Trump and Cohen owe him $1.5 million in attorney’s fees as part of Daniels’ pending lawsuit over the nondisclosure agreement. “Thus they have to pay those attorney’s fees and whatever Trump is awarded would be deducted from the $1,500,000 before Trump and Cohen have to write the check to Stormy,” Avenatti said.