NEW YORK (AP) — Donald Trump was held in contempt of court Tuesday and fined $9,000 for repeatedly violating a gag order that barred him from making public statements about witnesses, jurors and some others connected to his New York hush money case. If he does it again, the judge warned, he could be jailed.

Prosecutors had alleged 10 violations, but New York Judge Juan M. Merchan found there were nine. Trump stared down at the table in front of him as the judge read the ruling, frowning slightly.

It was a stinging rebuke of the presumptive Republican presidential nominee’s insistence that he was exercising his free speech rights and a reminder that he’s a criminal defendant subject to the harsh realities of trial procedure. And the judge’s remarkable threat to jail a former president signaled that Trump’s already precarious legal standing could further spiral depending on his behavior during the remainder of the trial.

Merchan wrote that he is Trump’s First Amendment rights, “particularly given his candidacy for the office of President of the United States.â€

“It is critically important that defendant’s legitimate free speech rights not be curtailed, that he be able to fully campaign for the office which he seeks and that he be able to respond and defend himself against political attacks,†Merchan wrote.

Still, he warned that the court would not tolerate "willful violations of its lawful orders and that if necessary and appropriate under the circumstances, it will impose an incarceratory punishment.â€

With that statement, the judge drew nearer the specter of Trump becoming the first former president of the United States behind bars.

“This gag order is totally unconstitutional,†Trump said as court adjourned after a day that included testimony from a Hollywood lawyer who negotiated two of the hush money deals at issue in the case. “I’m the Republican candidate for president of the United States ... and I’m sitting in a courthouse all day long listening to this stuff.â€

Trump is used to having constant access to his social media bullhorn to slam opponents and speak his mind. After he was banned from Twitter following , Trump launched his own platform, where his posts wouldn’t be blocked or restricted. He has long tried to distance himself from controversial messages he’s amplified to his millions of followers by insisting they’re “only retweets.â€

But he does , which were also imposed in other legal matters. After he was found to have violated orders he paid more than $15,000 in fines.

That order limits what he can say about known or reasonably foreseeable witnesses in the case and about court staff and other lawyers, though an appeals court freed him to speak about special counsel Jack Smith, who brought the case.

Tuesday's ruling in New York came at the start of the second week of testimony in the historic case, which involves allegations that Trump and his associates took part in an illegal scheme to influence the 2016 presidential campaign by purchasing and then burying seamy stories. The payouts went to a doorman with a torrid yarn; ex-Playboy model Karen McDougal, who had accusations of an affair; and to porn performer Stormy Daniels, who alleged a sexual encounter with Trump. He has pleaded not guilty and says the stories are all fake.

Trump deleted, as ordered, the offending posts from his Truth Social account and campaign website and has until Friday to pay the fine. The judge was also weighing and will hear arguments Thursday. He also announced that he will halt the trial on May 17 to allow Trump to attend his son Barron's high school graduation.

Of the 10 posts, the one Merchan ruled was not a violation came on April 10, a post referring to witnesses Michael Cohen and Daniels as “sleaze bags." Merchan said Trump’s contention that he was responding to previous posts by Cohen “is sufficient to give†him pause on whether the post was a violation.

Merchan cautioned that the gag order “not be used as a sword instead of a shield by potential witnesses†and that if people who are protected by the order, like Cohen, continue to attack Trump “it becomes apparent†they don’t need the gag order’s protection.

Cohen, Trump’s former attorney, has said he will refrain from commenting about Trump until after he testifies. On Tuesday, he said in a text message to The Associated Press: “Judge Merchan’s decision elucidates that this behavior will not be tolerated and that no one is above the law."

In other developments, testimony resumed Tuesday with a banker who helped Cohen open accounts, including one used to buy Daniels' silence. Trump’s attorneys have suggested that the payments were aimed at protecting his name and his family — not influencing the outcome of the presidential election.

Jurors also began , a lawyer who represented McDougal and Daniels in their negotiations with the ºÚÁϳԹÏÍø Enquirer and Cohen. He testified that he arranged a meeting at his Los Angeles office during the summer of 2016 to see whether the tabloid's parent company American Media, Inc. was interested in McDougal’s story. At first they demurred, saying she “lacked documentary evidence of the interaction,†Davidson testified.

But the tabloid eventually bought the rights, and Davidson testified that he understood — and McDougal preferred — it would never be published. Asked why American Media Inc., would buy a story it didn’t intend to run, Davidson said he was aware of two reasons.

“One explanation I was given is they were trying to build Karen into a brand and didn’t want to diminish her brand,†he said. “And the second was an unspoken understanding that there was an affiliation between David Pecker and Donald Trump and that AMI wouldn’t run this story, any story related to Karen, because it would hurt Donald Trump.â€

As for Daniels, the October 2016 leak of — in which Trump bragged about grabbing women sexually without asking permission — had “tremendous influence†on the marketability of her story. Before the video was made public, “there was very little if any interest†in her claims, Davidson told jurors.

A deal was reached with the tabloid for Daniels story, but the Enquirer backed out. Though Pecker testified that he had agreed to serve as the Trump campaign’s “eyes and ears†by helping to squelch unflattering rumors and claims about Trump and women, he drew the line with Daniels after to scoop up and sit on stories. Davidson began negotiating with Cohen directly, hiked up the price to $130,000, and reached a deal.

But Daniels and Davidson grew frustrated as weeks passed and instead of the money, she got excuses from Cohen about broken computers, Secret Service “firewalls†and the Jewish holiday of Yom Kippur.

“I thought he was trying to kick the can down the road until after the election,†Davidson said.

While Cohen never explicitly said he was negotiating the deal on Trump’s behalf, Davidson felt the implication was clear.

“Every single time I talked to Michael Cohen, he leaned on his close affiliation with Donald Trump,†Davidson said. Plus, he figured that Trump “was the beneficiary of this contract.â€

The GOP presidential hopeful is charged with in connection with the hush money payments. The detailed evidence on business transactions and bank accounts is setting the stage for testimony from Cohen, who went to federal prison after and other crimes.

The trial — the first of to come before a jury — is expected to last for another month or more.

___ Long reported from Washington. Associated Press writers Zeke Miller in Washington and Jill Colvin in New York contributed to this report.

ºÚÁϳԹÏÍø. All rights reserved.