Former President Trump withdrew his lawsuit against New York Attorney General Letitia James on Friday, after he and his legal team were ordered to pay more than $900,000 on Thursday for repeatedly filing “frivolous” lawsuits.

U.S. District Judge Donald Middlebrooks, who also served as the presiding judge in Trump’s case against James, pointed to the lawsuit in Thursday’s order as an example of the former president’s “pattern of misusing the courts to serve political purposes.”

After James filed a civil lawsuit against Trump and his three adult children in September over allegations of business fraud, the former president responded by suing the New York attorney general in November. 

Trump claimed that James “abused her position as Attorney General for the State of New York to pursue a vendetta” against him.

In her lawsuit, James accused Trump and his children of falsely inflating and deflating property values to obtain investments and tax and loan benefits, following a three-year investigation into the former president’s business practices.

Middlebrooks noted in Thursday’s order that he had previously warned Trump and his lawyers that the lawsuit had “all the telltale signs of being both vexatious and frivolous.”

“Mr. Trump is a prolific and sophisticated litigant who is repeatedly using the courts to seek revenge on political adversaries,” the judge noted in the scathing, 46-page order. “He is the mastermind of strategic abuse of the judicial process.”