A federal judge ruled on Thursday that former President Donald Trump and his attorneys face roughly $1 million in fines as a result of a lawsuit Trump filed against Hillary Clinton.

"We are confronted with a lawsuit that should never have been filed, which was completely frivolous, both factually and legally, and which was brought in bad faith for an improper purpose," Judge John Middlebrooks in U.S. District Court for the Southern District of Florida in his order sanctioning Trump and his attorney Alina Habba, wrote.

In his lawsuit, Trump charged Clinton and 30 other defendants with plotting to "weave a false narrative" during the 2016 election that he and his campaign were working together with Russia to win the election. The lawsuit sought $70 million in damages.

The request for sanctions made by one of the defendants in Trump's lawsuit had previously been approved by Middlebrooks. This order, which called for sanctions totaling more than $66,000, was suspended while Trump's lawyers filed an appeal. A request from a number of additional defendants, including Clinton, led to the most recent decision, which imposed $937,989 in sanctions.

"I find that the pleadings here were abusive litigation tactics," the judge wrote in the latest order. "The Complaint and Amended Complaint were drafted to advance a political narrative; not to address legal harm caused by any Defendant."

The judge cited Trump's "pattern of misusing the courts to serve political purposes" as he listed several prior failed cases brought by Trump in recent years.

Trump and Habba are equally and severally liable under the ruling for the total amount of sanctions issued by the judge to compensate the defendants' legal fees and costs: $937,989.39. This is nearly $120,000 less than the defendants' total request for sanctions.

Clinton was awarded $171,631 in sanctions to be paid by Trump and Habba, with the majority of the money set aside for Clinton's legal fees.

The Democratic National Committee, its former chairwoman Rep. Debbie Wasserman Schultz of Florida, and a connected corporation received $179,685 as the second-largest sum granted in Middlebrooks' order.

"Frivolous lawsuits should not be used as a vehicle for fundraising or fodder for rallies or social media," Middlebrooks wrote.

Middlebrooks' decision is the most recent in a string of humiliating legal failures for Trump, which also include the criminal conviction of his Manhattan-based real estate company, The Trump Organization, for a lengthy tax dodging scheme last month in a New York state court.

Trump is also being sued by the author E. Jean Carroll, who accuses him of raping her in the 1990s in New York, and his company is also the target of a significant civil lawsuit brought by the attorney general of New York for an alleged scheme to inflate the value of real estate assets for financial gain.