“Jeez,” Mr Costello sighed into the microphone as Justice Juan Merchan repeatedly sustained objections from prosecutors, cutting off his responses.

“I’m sorry?” the judge immediately responded in a frustrated tone.

From that point on, things only escalated as Mr Costello later appeared to groan at more objections, and long sidebars between lawyers and the judge.

Justice Merchan, apparently hitting his limit, asked jurors to leave the room so he could discuss “proper decorum in my courtroom” with Mr Costello.

With the jurors out of sight, Justice Merchan began to chastise the former federal prosecutor who Cohen said served as a back channel, connecting him with Mr Trump and the White House in 2018.

“You don’t say ‘jeez’. And then if you don’t like my ruling, you don’t give me side eye, and you don’t roll your eyes,” he told the witness.

Mr Costello seemed to make a face at Justice Merchan as he scolded him, sparking another fiery response from the judge.

“Are you staring me down?” he barked shortly.

“Clear the courtroom,” Justice Merchan said, prompting court officers to shout at the dozens of members of the public and reporters to leave immediately.

Some journalists objected to being kicked out of the public proceedings, but ultimately obeyed as officers shooed people from the room.

Reporters stood stunned in the hallway for several minutes before officers allowed everyone back into the room.