Donald Trump's day in court was never going to go any other way.
On the stand for a landmark fraud trial, he approached his testimony just as he had his real estate business and political career: ignoring the rules and technicalities, and blustering and bragging his way through it.
His aggressive and freewheeling appearance on Monday offered a glimpse at how he may behave as a defendant in the four upcoming criminal cases against him.
The former president repeatedly angered Judge Arthur Engoron by refusing to directly answer the questions put to him by the attorney general's office.
Yes-or-no questions about accounting documents and dates became extended riffs on the incredible values of his properties, or the partisan leanings of the judge and prosecutors.
At one point, Mr Trump declared: "This is a very unfair trial...and I hope the public is watching."
While cameras were not allowed inside, dozens of reporters gathered in the courtroom to transmit his testimony to the outside world.
Likely understanding this fact, Mr Trump used his time on the stand to ardently defend himself with the same language he has used in social media statements and stump speeches to rile up his base. His Truth Social account even posted an attack on the judge during an afternoon break.
The attorney general's office and other prosecutors "were coming after me from 15 sides", he said in response to one question.
"All Democrats, all Trump haters, all cases that are not good," he said. "Weaponisation, they call it."
At times his responses were boastful, or simply odd.
To a question from Kevin Wallace of the attorney general's office about his brand's valuation, Mr Trump bragged: "I became president because of my brand."
And in response to questions about his golf course in Scotland, Mr Trump reverted to his political opposition to windfarms, one of which was built offshore from his club. "I'm not a windmill person," he said.
Evasive and partisan answers continued on like this all morning.
"Can you control your client?" Judge Engoron asked Mr Trump's attorneys at one point. "This is not a political rally."
It was one of several reprimands issued from the bench throughout the morning.
Witnesses usually do not speak without prompting, let alone at such length. But Mr Trump is no normal defendant.
His lawyer Chris Kise admitted as much after the umpteenth admonishment from Judge Engoron.
"It's an unusual situation," he said, arguing that Mr Trump should be allowed to speak due to his unique position.
The judge, however, was determined to treat Mr Trump like any other defendant.
Returning from the afternoon recess, Mr Trump was notably more subdued. Although there was one outburst about Ms James that the prosecution simply ignored, he stuck to shorter answers.
The attorney general's office has accused Mr Trump, his top employees and his companies of fraudulently inflating the value of their assets on statements of financial condition, or balance sheets, to get more favourable loans.
While on the stand, the 45th president tried to seize the opportunity to boast about the value of his brand - a path he used to great effect when launching his political career nearly a decade ago.
In between outbursts, Mr Trump tried to hammer home a defence that his assets were actually worth far more than the numbers on paper and that the banks he allegedly defrauded were paid back in full.
He claimed his Florida estate Mar-a-Lago was worth a "very big number", far in excess to the one listed on his statements of financial condition.
And he boasted that Trump Tower, his Fifth Avenue skyscraper, occupied the "best location in New York".
Mr Trump has been on the stand before. In fact, Judge Engoron put him there briefly earlier in the trial, after he made remarks that the judge believed referred to his clerk.
But he is doing so as a former president, current frontrunner for the Republican nomination, and a defendant in four separate criminal trials that, unlike this case, come with jail time. Those trials will play out one by one next year in tandem with the US presidential election.
With the threats against him mounting, Mr Trump has grown more aggressive in his rhetoric, reverting to the political street brawler that saw him seize the 2016 Republican nomination from establishment lawmakers.
He has attacked prosecutors directly by name, and lashed out at court staffers.
Judge Engoron placed Mr Trump under a gag order in early October after he made disparaging comments about his clerk, who sits to his right. So far, he has fined Mr Trump $15,000 (£12,150) and put his attorneys under a gag order as well, after they claimed the clerk was biased.
Midway through his morning testimony, Mr Trump dared to take a swipe directly at the judge.
"I'm sure the judge will rule against me because he always rules against me," Mr Trump said.
"You can attack me, you can do whatever you want," Judge Ergonon said. "But answer the question."
With additional reporting from Madeline Halpert & Chloe Kim in court in New York