The judge in Donald Trump’s hush money trial cleared the courtroom of reporters on Monday and threatened to remove a defence witness from the trial because of his behavior on the stand, a court transcript showed.

Judge Juan M Merchan told Robert Costello, a former federal prosecutor, that his conduct was “contemptuous right now”.

Mr Costello aggravated Mr Merchan repeatedly in his testimony by making comments under his breath and continuing to speak after objections were sustained — a signal to witnesses to stop talking.

At one point, Mr Costello remarked “jeez” when he was cut off by an objection. He also called the whole exercise “ridiculous”.

“I’m putting you on notice that your conduct is contemptuous,” Mr Merchan said, according to the transcript of the conversation that occurred when the press was out of the room.

”If you try to stare me down one more time, I will remove you from the stand.”

Mr Costello did not return a message seeking comment on Monday night.

“The fact that I had to clear the courtroom and that the court officers, including the captain, had great difficulty clearing the courtroom, and that there was argument back and forth between the press and including counsel for the press, goes to why I had to clear the courtroom in the first place,” Mr Merchan told Mr Costello.

APTOPIX Trump Hush Money
Judge Juan Merchan, left, castigates witness Robert Costello about his “decorum” in the courtroom in Manhattan criminal court, Monday, May 20, 2024, in New York. (Elizabeth Williams via AP)

“And that is, sir, your conduct is contemptuous right now.”

When he brought the press back in, Mr Costello’s testimony continued and it will resume on Tuesday. The defence is using him in an effort to attack the credibility of Trump’s lawyer-turned-adversary Michael Cohen.

Trump’s lawyers also pressed the judge to stop the case from going to the jury and throw out the charges after prosecutors concluded their presentation of evidence.

He did not immediately rule on the request, which came at the end of a heated day that also included the prosecution’s star witness admitting to stealing tens of thousands of dollars from Trump’s company.

APTOPIX Trump Hush Money
Former president Donald Trump sits in Manhattan Criminal Court during his ongoing hush money trial (AP)

After jurors left for the day, defence lawyer Todd Blanche told the judge prosecutors had failed to prove their case and that it should be thrown out immediately.

Mr Blanche beseeched the judge to “not let this case go to the jury relying on Mr Cohen’s testimony”.

The judge appeared unmoved by the argument, asking the defence attorney whether he believed that “as a matter of law, this person’s so not worthy of belief that it shouldn’t even be considered by the jury?”.

“You said his lies are irrefutable,” the judge said. “But you think he’s going to fool 12 New Yorkers into believing this lie?”

Mr Cohen was the last scheduled witness for prosecutors, who are trying to prove Trump sought to bury unflattering stories about himself and then falsified internal business records to cover it up as part of a scheme to illegally influence the 2016 presidential election.

Trump has pleaded not guilty. His lawyers say there was nothing criminal about the Stormy Daniels deal or the way Mr Cohen was paid.

“There’s no crime,” Trump told reporters after arriving at the courthouse on Monday. “We paid a legal expense. You know what it’s marked down as? A legal expense.”

Prosecutors will have an opportunity to call rebuttal witnesses once Trump’s witnesses are done. The judge, citing scheduling issues, said he expects closing arguments to happen on May 28.