A judge has ordered adult film star Stormy Daniels to pay $293,000 in legal fees to President Donald Trump after her defamation lawsuit against the president was dismissed in October.

>> Read more trending news

Daniels, whose real name is Stephanie Clifford, filed suit in April contending Trump defamed her in a social media post last April that made fun of her allegations that a man threatened her in 2011, ordering her to keep quiet about her alleged affair with Trump.

Trump posted a photo of the sketch of the purported suspect and a photo of Daniels’ ex-husband, suggesting that the suspect was actually her ex.

The court ordered Daniels to pay $293,052.33 in attorney fees, plus $1,000 in sanctions. Trump's attorneys had requested $340,000 in legal fees.

The judge wrote in his decision that the president's attorney's spent "excessive" time on the case, The Hill reported.

Trump’s lawyer Charles Harder issued a statement after Tuesday’s decision calling the ruling “a total victory for the President, and a total defeat for Stormy Daniels.”

Daniels attorney Michael Avenatti angrily told The Hill that "Harder and Trump deserve each other because both are dishonest."

"They received less than one half of what they asked for because the request was gross and excessive. Stormy will never [have] to pay a dime because they owe her over $1 million in attorney's fees and costs from the NDA case, especially in light of Cohen's guilty plea to a felony," Avenatti said, according to The Hill.

Daniels sued Trump and his former personal attorney and "fixer" Michael Cohen in an effort to break a so-called hush agreement she signed before the 2016 presidential election in exchange for $130,000 to keep quiet about an alleged affair with Trump in 2006. She claimed the agreement is non-binding because Trump never signed it.

Cohen has since pleaded guilty to violating campaign finance laws, related to the payment made to Daniels, and other financial crimes and is awaiting sentencing this week. Prosecutors have recommended "substantial" prison time for Cohen.