A federal appeals court on Wednesday upheld an almost $1 million penalty against President Donald Trump and his attorneys for “sanctionable conduct” in a racketeering lawsuit they brought against Hillary Clinton and other Democrats over the 2016 election.

The 11th U.S. Circuit Court of Appeals panel upheld the dismissal of Trump’s $24 million lawsuit, agreeing that many of its legal arguments “were indeed frivolous.”

The three-judge panel also found that U.S. District Judge Donald M. Middlebrooks of Southern Florida did not err when he sanctioned Trump and his then-lawyer and now-acting New Jersey U.S. Attorney Alina Habba and ordered them to pay $937,989.39 for their “bad faith” arguments.

The suit had alleged that in the lead-up to the 2016 election, Clinton conspired with others to “weave a false narrative” about Trump and Russia, to “discredit, delegitimize and defame” him.

Middlebrooks found that the suit was filled with frivolous claims, including a “malicious prosecution claim without a prosecution,” and a “trade secret claim without a trade secret.”

“This case should never have been brought. Its inadequacy as a legal claim was evident from the start. No reasonable lawyer would have filed it,” Middlebrooks wrote. He said the suit was intended to “harass” and was being used “for a political purpose.”

The then-former president, he said, knew better.

“Mr. Trump is a prolific and sophisticated litigant who is repeatedly using the courts to seek revenge on political adversaries. He is the mastermind of strategic abuse of the judicial process, and he cannot be seen as a litigant blindly following the advice of a lawyer. He knew full well the impact of his actions,” Middlebrooks wrote, finding that “sanctions should be imposed upon Mr. Trump and his lead counsel, Ms. Habba.”

A spokesman for Trump’s legal team said it “continues to fight back against all Democrat-led Witch Hunts, including the ‘Russia, Russia, Russia’ hoax.”

“President Trump will continue to pursue this matter to its just and rightful conclusion,” the spokesman said.