A New York appeals court has again upheld a gag order that bars Donald Trump from commenting about court personnel in his civil fraud trial, ruling that the former president's lawyers used the wrong legal mechanism to fight the restriction.

A four-judge panel in the state's midlevel appellate court ruled Thursday that Trump's lawyers erred by suing trial Judge Arthur Engoron, who imposed the gag order in October after Trump disparaged his law clerk.

Instead, the appellate judges wrote, Trump's lawyers should've followed the normal appeals process by asking Engoron to reverse the gag order and then, if denied, fighting that decision in a higher court.

Trump lawyer Christopher Kise said the decision denies his client "the only path available to expedited relief and places his fundamental constitutional rights in a procedural purgatory."

"We filed the petition because the ordinary appellate process is essentially pointless in this context as it cannot possibly be completed in time to reverse the ongoing harm," Kise said.

The appeals court ruling came a day after testimony wrapped in the two-and-a-half-month trial in New York Attorney General Letitia James' lawsuit. Closing arguments are scheduled for Jan. 11 in the case, which threatens Trump's real estate empire. Engoron said he hopes to have a verdict by the end of January.

Trump's lawyers sued Engoron in last month, objecting to the gag order as an abuse of power. They filed the lawsuit under a state law known as Article 78, which allows lawsuits over some judicial decisions.

The four-judge panel ruled that Trump's gag order can't be challenged that way, citing a prior ruling from the state's highest court that characterized such lawsuits as an "extraordinary remedy."

"Here, the gravity of potential harm is small, given that the Gag Order is narrow, limited to prohibiting solely statements regarding the court's staff," the panel wrote.

Engoron imposed the gag order Oct. 3 after Trump, the leading contender for the 2024 Republican presidential nomination, posted a derogatory comment about the judge's law clerk to social media. The post, which included a baseless allegation about the clerk's personal life, came on the second day of the trial.

Judge David Friedman of the appeals court suspended the gag order on Nov. 16, citing "constitutional and statutory" concerns, but a four-judge panel restored it on Nov. 30.

Over the trial's first few weeks, Engoron fined Trump $15,000 for violating the gag order. The judge expanded the order, which initially covered only parties in the case, to include lawyers after Trump's attorneys questioned the law clerk's prominent role on the bench.

State lawyers have supported the restriction, saying it was a reasonable step to protect Engoron's staff. A lawyer for the court system tied Trump's comments to an uptick in nasty calls and messages directed at the judge and law clerk.

Michael R. Sisak reports for the Associated Press.

Copyright 2023 AP. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.