NEW YORK--Donald Trump complained of unfair treatment in defiant and rambling testimony on the witness stand at the civil fraud trial about his New York business on Monday, prompting the judge at one point to threaten to cut his testimony short. Under questioning about his company's accounting practices, the former U.S. president clearly aggravated Judge Arthur Engoron, who is weighing whether to impose hundreds of millions of dollars in fines and other penalties that could hobble the real estate empire that vaulted Trump to prominence. Engoron warned Trump, the frontrunner for the Republican nomination in the 2024 election, that he might remove him from the witness stand if he did not answer questions directly. "Can you control your client?" Engoron asked Trump's lawyer, Christopher Kise. "This is not a political rally. This is a courtroom." Trump's testimony wrapped up in midafternoon. His daughter Ivanka is due to testify on Wednesday, though she is not a defendant in the case. Over roughly four hours on the witness stand, Trump often avoided direct answers, instead bragging about his properties and his wealth. He accused New York Attorney General Letitia James, an elected Democrat, of targeting him to further her political career and accused Engoron of lowballing the value of his properties. "I think this case is a disgrace. Many people are leaving New York because of exactly this kind of thing," he said. "It's election interference because you want to keep me in the courthouse." Both Engoron and Trump repeatedly raised their voices as the judge sought to prevent Trump from using the court to air his grievances. "I'm not here to hear what he has to say. I'm here to hear him answer questions. Sit down already," Engoron told Alina Habba, another one of Trump's lawyers. Habba later told the judge that they would ask for a mistrial, though it is unlikely they will be successful. Engoron has already found Trump, his adult sons and 10 of his companies liable for fraud, describing in scathing terms how the defendants made up valuations. Engoron's ruling could strip Trump's control of some of his best known properties, though that order is on hold during appeal. Amid the fireworks, Trump acknowledged that he was involved in some of the documents at the heart of the fraud case, in which New York state lawyers say his company pumped up the value of apartment towers, golf courses and other assets to win better financing terms. Trump acknowledged that those estimates were not always accurate. Some properties, like his Mar-a-Lago estate and Doral golf course in Florida were undervalued, he said, while others like his Trump Tower residence in New York and his Seven Springs estate north of the city were overvalued. He said that should not matter because the estimates included language saying they might not be accurate and his lender Deutsche Bank cared more about the amount of cash he had on hand. "I've had a lot of cash for a long time," Trump said. New York state lawyers said in their lawsuit that the estimates misled lenders and insurers, earning him more than $100 million and exaggerating his wealth by $2 billion. Trump accused legal authorities of paying unduly close attention to his business after he won the 2016 presidential election. "This is a very unfair trial, very, very unfair, and I hope the public is watching," he added later. At one point, Engoron asked Kise to take Trump to the back of the courtroom and explain the rules. "The former and again soon to be president of the United States understands the rules," Kise responded.