Donald Trump's court appearances are no longer distractions from his campaign to return to the White House. They are central to it.

The dynamic was on full display this week as the former president and GOP front-runner returned to New York for the opening two days of a civil fraud trial accusing him of grossly inflating the value of his businesses.

Trump was under no obligation to appear and did not address the court. But he nonetheless seized the opportunity to create a media spectacle that ensured he was back in the spotlight. And he once again portrayed himself as a victim of a politicized justice system, a posture that has helped him emerge as the undisputed leader of the 2024 GOP primary.

On Monday, the scene was much like the one that has played out over and over since the spring as Trump has reported to courthouses and a local jail to be processed in four criminal indictments. Once again, reporters waited in line overnight to snag seats in the courtroom; news helicopters tracked his motorcade journey from Trump Tower to the courthouse in lower Manhattan; and cable networks carried the spectacle live on TV.

The appearance demonstrated how deftly Trump has used his legal woes to benefit his campaign. The former president's appearance drew far more attention than a standard campaign rally would have offered. And it gave Trump a fresh opportunity to rile up his base and gin his fundraising with claims that the cases he faces are nothing more than a coordinated attempt to damage his campaign.

"It's a scam, it's a sham," he said in the morning. "It's a witch hunt and a disgrace."

While some rivals had once thought Trump's long list of legal woes might dissuade Republican voters from choosing him as their nominee, his standing in the GOP primary has only improved since before the indictments and helped him raise millions of dollars.

While other politicians might shy away from drawing additional attention to accusations of wrongdoing, Trump took full advantage of the cameras.

He addressed the media assembled outside the courtroom multiple times throughout the day, railing against the case and offering commentary, and did the same as he arrived at court Tuesday morning.

"Every lawyer would say, 'Don't talk.' Every candidate would obey the lawyer. Trump just throws out the playbook," said former White House press secretary Ari Fleischer.

Fleischer said that, for Trump, the lines between campaigning and the courtroom have now been erased.

"Every day is a day on the stump, whether it's in Iowa, New Hampshire or in the courtroom," he said, adding, "Every appearance is an opportunity to ring a bell, strike a message, say he's the victim of a weaponized Justice Department and he's the only one who can change Washington."

The civil fraud case, brought by New York Attorney General Letitia James, accuses Trump and his company of deceiving banks, insurers and others by chronically overstating his wealth by as much as $3.6 billion.

Judge Arthur Engoron has already ruled that Trump committed fraud. If upheld on appeal, the case could cost the former president control of some of his most prized properties, including Trump Tower, a Wall Street office building and golf courses. James is also seeking $250 million in penalties and a ban on Trump doing business in New York.

Trump spent the day seated at the defense table observing the proceedings, at times leaning to confer with his lawyers.

The former president grew visibly angry during the morning's opening statements, railing against the suggestion that he was worth less than he claimed and blasting both the judge and James. Trump sneered at the state attorney general as he walked past her on his way out of the courtroom during a lunch break, cocking his head toward her and glaring.

But by the end of the day, Trump's mood had changed. He exited the courtroom claiming he'd scored a victory, pointing to comments that he said showed the judge coming around to the defense view that most of the suit's allegations happened too long ago to be considered. Kevin Wallace, a lawyer in James' office, promised to link the cited incidents to a more recent loan agreement.

Still, Trump complained that he'd "love to be campaigning instead of doing this."

"This was for politics," he said. "Now, it has been very successful for them because they took me off the campaign trail 'cause I've been sitting in a courthouse all day long instead of being in Iowa, New Hampshire, South Carolina or a lot of other places I could be at."

This will be the reality of his campaign going forward as he alternates between visits to early voting states and courtrooms, including to testify later in the New York civil trial. On Feb. 15, he will have to make an in-person court appearance in New York ahead of a criminal trial in which he is accused of misclassifying hush money payments made to women during his 2016 campaign. His federal trial in Washington on charges related to his efforts to overturn the 2020 election is tentatively set to begin March 4, his New York trial is set to begin March 25 and his federal trial in the Mar-a-Lago documents case is set to begin on May 20.

His trial in Georgia over his efforts to subvert the results of the state's 2020 election hasn't yet been scheduled.

Plans for Trump to attend the New York trial's first days were first revealed in legal filings last week. Lawyers representing Trump in a separate lawsuit against his former lawyer Michael Cohen used his appearance to put off a deposition.

Trump had also said in May that he wanted to attend an earlier civil trial brought by writer E. Jean Carroll accusing him of rape, but did not end up doing so. A jury found him liable for sexually assaulting her in a department store dressing room.

In a post on his social media site, Trump said he wanted to appear in court Monday "to fight for my name and reputation."

"I want to watch this witch hunt myself," he told reporters. "I've been going through a witch hunt for years, but this is really now getting dirty."

Trump is expected to return to testify in the case in several weeks.

Jill Colvin reports for the Associated Press. AP writer Michael R. Sisak in New York contributed to this report.

Copyright 2023 AP. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.