Donald Trump has stormed out of a courtroom - having earlier been fined $10,000 (£8,200) for breaching a gag order barring him from personally attacking court staff in his fraud trial.
The fine came after Mr Trump was called to the witness stand to explain his comment outside the courtroom about "a person who's very partisan sitting alongside" the judge in the case, Judge Arthur Engoron.
Weeks ago, Judge Engoron ordered all participants in the trial not to comment publicly about his staff.
The narrow gag order imposed on 3 October came after Mr Trump made a social media post maligning the judge's principal law clerk, who sits beside Judge Engoron in court.
The judge ordered Mr Trump to take down that post and the former president did. But it lingered on his campaign website for weeks, prompting a $5,000 (£4,100) fine for the Republican on Friday.
During a break in the trial over a lawsuit regarding Mr Trump's business practices, Mr Trump told reporters, "this judge is a very partisan judge, with a person who's very partisan sitting alongside of him, perhaps even much more partisan than he is."
Judge Engoron, surmising that Mr Trump was referring to his clerk, called the comments a "blatant" violation of the gag order.
Mr Trump and his lawyers said his comment on Wednesday was about witness Michael Cohen, not the clerk.
Three of Mr Trump's attorneys objected to the fine, insisting that the comment was referring to Mr Cohen, and they reiterated the Republican frontrunner's claim that the judge's law clerk was unfairly biased.
Mr Cohen is a key witness in New York attorney general Letitia James' civil case against Mr Trump.
Ms James alleges that Mr Trump habitually exaggerated the value of his real estate holdings on financial documents that helped him get loans and insurance and make deals.
In an exchange shortly after the fine had been issued, Mr Cohen was sked if Mr Trump or former Trump Organisation CFO Allen Weisselberg directed him to inflate the numbers on his personal statement.
"Not that I recall," Mr Cohen responded.
Cliff Robert, an attorney for the Trumps, then asked for a directed verdict, arguing that the key witness testified that the defendant did not tell Mr Cohen to inflate the numbers.
A directed verdict have involved the judge effectively dismissing the case on the basis there was insufficient evidence for a conviction.
However, the judge denied the request, prompting Mr Trump to throw his arms in the air and storm out of the courtroom so fast his Secret Service agents had to chase after him.
The move was not expected and appeared to surprise even his attorneys, while prompting audible gasps within the courtroom.
Mr Cohen later added that Mr Trump did not specifically tell him to inflate the numbers, comparing the former president to a mob boss who tells you what he wants without directly telling you.
Mr Trump denies any wrongdoing and says Ms James, a Democrat, is targeting him for partisan reasons.