NEW YORK (AP) — Former President Donald Trump defended his wealth and business on Monday, tangling from the witness stand with the judge overseeing his civil fraud trial and denouncing as a “political witch hunt” a lawsuit accusing him of dramatically inflating his net worth.

Trump’s long-awaited testimony about property valuations and financial statements was punctuated by personal jabs at a judge he said was biased against him and at the state attorney general, whom he derided as a “political hack.” He proudly boasted of his real estate business — “I’m worth billions of dollars more than the financial statements” — and disputed claims that he had deceived banks and insurers.

“This is the opposite of fraud,” he declared. Referring to New York Attorney General Letitia James, a Democrat whose office brought the case, he said, “The fraud is her.”

The testy exchanges underscored Trump’s unwillingness to adapt his famously freewheeling rhetorical style to a formal courtroom setting governed by rules of evidence and legal protocol. But while his presence on the stand was a vivid reminder of the legal woes he faces as he vies to reclaim the White House in 2024, it also functioned as a campaign platform for the former president and leading Republican presidential candidate to raise anew his claims of political persecution at the hands of government lawyers and judges.

Trump’s testimony got off to a contentious start Monday, with state Judge Arthur Engoron admonishing him to keep his answers concise and reminding him that “this is not a political rally.”

“We don’t have time to waste,” the exasperated judge said at one point. At another, turning to Trump’s attorney, the judge said, “I beseech you to control him if you can. If you can’t, I will.”

The civil trial is one of numerous legal proceedings Trump is confronting, including federal and state charges accusing him of crimes including illegally hoarding classified documents and scheming to overturn the 2020 presidential election. His legal and political strategies have now become completely intertwined as he hopscotches between campaign events and court hearings — a schedule that will only intensify once his criminal trials begin.

Though the fraud case doesn’t carry the prospect of prison as the criminal prosecutions do, its allegations of financial improprieties cut to the heart of the brand he spent decades crafting, and the suggestion that Trump is worth less than he’s claimed has been interpreted by him as a cutting insult.

“I’m worth billions of dollars more than the financial statements,” he said, telling a state lawyer, “You go around and try and demean me and try and hurt me, probably for political reasons.”

The courtroom at 60 Centre St. has become a familiar destination for Trump. He has spent hours over the past month voluntarily seated at the defense table, observing the proceedings. He took the stand previously, unexpectedly and briefly, after he was accused of violating a partial gag order. He denied violating the rules, but Engoron disagreed and fined him anyway.

Before Monday, Trump’s speaking had occurred outside the courtroom, where he has taken full advantage of the bank of assembled media to voice his outrage and spin the days’ proceedings in the most favorable way. But his turn on the witness stand gave him the biggest opportunity yet to respond to the details against him.

Tensions between Engoron and Trump, already on display in recent weeks, when the judge fined him a total of $15,000 for incendiary outside-of-court comments, were evident Monday when the ex-president was repeatedly scolded about the length and content of his answers.

“Mr. Kise, can you control your client? This is not a political rally. This is a courtroom,” Engoron told Trump lawyer Christopher Kise, who himself has clashed with the judge. Kise responded that Trump was entitled to latitude as a former president and current candidate taking time away from the campaign to be on the witness stand.

“The court needs to hear what he has to say about these statements, why they’re viable and why there was no intent” to deceive anyone, Kise said.

Engoron, who determined in a ruling earlier that Trump committed fraud for years while building the real estate empire that catapulted him to fame, cautioned at one point that he was prepared to draw “negative inferences” against the former president if he failed to rein in his answers.

“I do not want to hear everything this witness has to say. He has a lot to say that has nothing to do with the case or the questions.”

Despite the testy back-and-forth early in the day, Trump was later able to veer into expansive answers without anyone cutting him off, using the opportunity to rail against James, the judge and the proceedings in general.

“I think that she’s a political hack, and I think she used this case to try and become governor and she used it successfully to become attorney general. I think it’s a disgrace that this case is going on,” Trump said.

James, who was in the courtroom, stared straight ahead at Trump as he spoke. Outside court, she said, “At the end of the day the only thing that matters are the facts and the numbers, and numbers, my friends, don’t lie.”

Of Engoron, Trump said, “He ruled against me and he said I was a fraud before he knew anything about me.”

The questions in Monday’s testimony centered on the core of the allegations by the state attorney general: that Trump and his company intentionally inflated property values and deceived banks and insurers in the pursuit of business deals and loans.

Echoing the stance taken by two of his sons, Donald Trump Jr. and Eric, in their own testimony, Trump sought to downplay his direct involvement in preparing and assessing the financial statements that the attorney general claims were grossly inflated and fraudulent.

“All I did was authorize and tell people to give whatever is necessary for the accountants to do the statements,” he said. As for the results, “I would look at them, I would see them, and maybe on some occasions, I would have some suggestions.”

He also played down the significance of the statements, which went to banks and others to secure financing and deals. As he had in the lead-up to testifying, Trump pointed to a disclaimer that he said amounted to telling recipients to do their own calculating.

“Banks didn’t find them very relevant, and they had a disclaimer clause — you would call it a worthless statement clause,” he said, insisting that after decades in real estate, “I probably know banks as well as anybody … I know what they look at. They look at the deal, they look at the location.”

He complained that his 2014 financial statements shouldn’t be a subject of the lawsuit at all.

“First of all it’s so long ago, it’s well beyond the statute of limitations,” Trump said before turning on the judge, saying he allowed state lawyers to pursue claims involving such years-old documents “because he always rules against me.”

Engoron said: “You can attack me in whichever way you want but please answer the questions.”