NEW YORK (AP) — A New York judge sternly imposed a limited gag order in Donald Trump’s civil business fraud trial Tuesday after the former president disparaged a key court staffer.

Amid a long day of testimony, Judge Arthur Engoron issued the order, which applies to all parties in the case and pertains to verbal attacks on court staff. It came after Trump maligned Engoron’s principal law clerk, Allison Greenfield, in a social media post.

The post included a photo of Greenfield with Senate Majority Leader Chuck Schumer, D-N.Y., posing for a picture at a public event. Trump, the Republican front-runner for president in 2024, has repeatedly cast the lawsuit and trial as a political attack by New York’s Democratic attorney general, Letitia James.

Trump wrote that it was “disgraceful” that Greenfield was working with the judge in the courtroom.

Aside from that sideshow, with Trump voluntarily attending the trial for a second day — and planning on a third — James’ attorney questioned an accountant in an effort to build the state’s case that Trump and others at his company had full control over the preparation of misleading and downright false financial statements at the heart of the case.

And Engoron set the record straight about a comment that the ex-president had touted as an important victory.

Engoron had suggested on Monday that testimony about Trump’s 2011 financial statement might be beyond the legal time limit applicable to James’ lawsuit. It alleges that Trump and his business chronically lied about his wealth on financial statements given to banks, insurers and others. Trump denies any wrongdoing.

The relevant statute of limitations rules out claims related to activities before a date in 2014, and Trump’s legal team has argued that the time limit cuts off most of the case.

Engoron ruled last week that all the claims were allowable under the statute of limitations. He said Tuesday that the trial isn’t “an opportunity to relitigate what I have already decided” and that at the trial’s early stage, he’s inclined to give both sides considerable leeway to connect older evidence to claims in the lawsuit.

Accountant Donald Bender continued testifying about his years preparing Trump’s financial statements from figures that Trump’s company supplied.

Be the First to Know: Get the 12 News App to receive breaking news alerts on your phone or tablet »

In some years, the Trump Organization failed to provide all documents necessary for producing the statements, despite attesting in letters to the account firm that it had provided all financial records and hadn’t “knowingly withheld” relevant data.

“They were not giving all of the documents that we needed,” Bender testified, explaining that “there were certain appraisals out there for a number of years that we had never seen.”

In cross-examining Bender, lawyer Jesus M. Suarez spoke in sweeping superlatives about Trump while questioning the accountant about the magnitude of working “for the 45th president of the United States, possibly even the 47th president of the United States.”

A lawyer for the state drew laughter in the courtroom when he objected to the question, citing relevance.

As for the gag order, without naming Trump, Engoron said that a defendant in the case “posted to a social media account a disparaging, untrue and personally identifying post about a member of my staff.” He added that “personal attacks on members of my court staff are unacceptable, not appropriate, and I will not tolerate them.”

Trump had already deleted the post. Engoron said he ordered it gone.

Trump also commented on the clerk’s role with the judge on Monday, saying that she “should not be allowed to be in his ear on every single question” and “hates Trump.”

The gag order came after Trump and lawyers for both sides repeatedly went into court behind closed doors during Tuesday’s lunch break. They had another private discussion after testimony ended, with journalists and others shooed again from the courtroom.

Trump emerged saying that he’d be back Wednesday.

Earlier, he reiterated key points of his defense, including that the financial statements bore disclaimers saying that they weren’t audited and that others “might reach different conclusions” about his financial position if they had more information.

“This case is a scam. It can’t be fraud when you’ve told institutions to do their own work,” Trump said Tuesday.

Trump plans to testify later in the trial, but he doesn’t have to attend it now. While grumbling that he’d rather be on the campaign trail, the Republican former president and 2024 GOP front-runner has used the waiting cameras in a courthouse hallway as a microphone for political messaging.

James scored an early victory when Engoron, a Democrat, ruled last week that Trump committed fraud by exaggerating the size of his penthouse at Trump Tower, claiming his Mar-a-Lago club in Florida was worth as much as $739 million and putting similar oversized valuations on office towers, golf courses and other assets.

The non-jury trial concerns six remaining claims in the lawsuit and how much Trump might owe in penalties. James is seeking $250 million and a ban on Trump doing business in New York. The judge has already ruled that some of Trump’s companies should be dissolved as punishment.

Trump’s lawyers said the financial statements were legitimate representations of the worth of unique luxury properties, made even more valuable because of their association with Trump.

The trial is expected to last into December.