Former U.S. President Donald Trump courted 2024 voters in the farm state of Iowa over the weekend, but on Tuesday he was in a Washington courtroom as his lawyers tried to convince three judges that he should be immune from charges of trying to illegally upend his 2020 election loss.

Such is the duality of political life for the 77-year-old Trump, commanding leader for the 2024 Republican presidential nomination even as he faces an unprecedented 91 charges across four criminal indictments in trials that could play out as he tries to fit in campaign rallies across the country.

While Trump would be required to appear daily at any criminal trials that are scheduled this year, he voluntarily elected to go before a stately federal appellate courtroom in Washington, blocks from the U.S. Capitol and White House on Tuesday.

His appearance was an apparent attempt to highlight his allegation that Democratic President Joe Biden and Justice Department special counsel Jack Smith are engaged in a political vendetta to keep him from reclaiming the White House in January 2025.

Trump was set to listen as his lawyers make the claim that since he was still in office in late 2020 and early 2021, he was carrying out his presidential duties by trying to ensure the 2020 election was conducted fairly, even though legal evidence indicates his only real concern was trying to upend his loss to Biden and stay in office for another four years.

Smith has charged Trump with illegally scheming to overturn the vote in various ways, including unsuccessfully imploring his vice president, Mike Pence, to refuse to uphold the Biden victory as Congress met on January 6, 2021, to certify the results of the Electoral College vote count.

In addition, Trump held White House discussions calling for the names of fake Trump-supporting electors to replace those legitimately supporting Biden, who narrowly won several key political battleground states in the 2020 election.

In the United States, presidents are not elected by the national popular vote, which Biden won by 7 million votes in 2020. Rather, U.S. presidents and their vice presidential running mates are elected through balloting in 50 state-by-state elections, with the most populous states holding the most electoral votes in the Electoral College.

About 2,000 Trump supporters delayed the eventual congressional certification of Biden’s victory in the Electoral College vote count three years ago when they stormed into the Capitol, fighting with police and ransacking some congressional offices. More than 1,200 protesters were arrested, with hundreds already convicted of an array of offenses.

FILE - Supporters of then-President Donald Trump storm the Capitol, in Washington, Jan. 6, 2021.

FILE – Supporters of then-President Donald Trump storm the Capitol, in Washington, Jan. 6, 2021.

Special counsel Smith is arguing that no one is above the law and immune from prosecution — not even a former president like Trump, the first ever U.S. leader charged with criminal offenses. U.S. Judge Tanya Chutkan, who is presiding over the election fraud case, agreed with the prosecutor, ruling that Trump is not entitled to a “get-out-of-jail-free pass.”

Trump appealed her no-immunity ruling. The U.S. Supreme Court rejected Smith’s bid to fast-track consideration of the issue — the legally untested question of whether an ex-president can be prosecuted for acts committed in the White House —.and sent it back to the appellate court in Washington.

Judges Michelle Childs and Florence Pan, both Biden appointees, and Karen LeCraft Henderson, who was named to the bench by former Republican President George H.W. Bush, are hearing the case.

Trump’s election fraud case in Washington is set to start March 4. Whether an appellate court ruling, and the almost certain appeal to the Supreme Court by the losing side, can be heard and decided quickly enough to allow the trial to start in less than two months is uncertain at best. Trump is trying to delay trials in all his cases until after the November election, and could, if reelected, order his attorney general to drop the two federal indictments against him.

In a legal brief, Smith’s lawyers argued, “Immunity from criminal prosecution would be particularly dangerous where, as here, the former President is alleged to have engaged in criminal conduct aimed at overturning the results of a Presidential election to remain in office beyond the allotted term.”

“A President who unlawfully seeks to retain power through criminal means unchecked by potential criminal prosecution could jeopardize both the Presidency itself and the very foundations of our democratic system of governance,” they added.

Trump has denied all wrongdoing in the four criminal cases.

“Of course I was entitled, as President of the United States and Commander in Chief, to Immunity,” he wrote in a social media post.

“I was looking for voter fraud, and finding it, which is my obligation to do, and otherwise running our Country,” he said.

Former presidents enjoy broad immunity from lawsuits for actions taken as part of their official White House duties. But courts have never addressed whether that protection extends to criminal prosecution, as no former president before Trump has ever been indicted.

With the nearly certain appeal from the losing side in the eventual appellate court ruling, the Supreme Court will play a key role in the 2024 election.

The high court has already decided to hear Trump’s appeal of a Colorado Supreme Court decision to keep him off the Republican primary election ballot in that state, ruling that his direct involvement in an insurrection on January 6, 2021 — when he directed supporters to go to the Capitol and “fight like hell” to block certification of the Electoral College vote count — makes him ineligible.

FILE - Then-President Donald Trump speaks during a rally protesting the electoral college certification of Joe Biden as president, in Washington, Jan. 6, 2021.

FILE – Then-President Donald Trump speaks during a rally protesting the electoral college certification of Joe Biden as president, in Washington, Jan. 6, 2021.

The Supreme Court has also agreed to review the case of a police officer charged with obstructing an official proceeding of Congress — the certification of Biden’s Electoral College victory — that also could affect Trump. The policeman contends that prosecutors wrongly used a corporate fraud statute usually reserved for people who tamper with documents and evidence.

Prosecutors have already charged more than 300 other Capitol rioters, forming the basis of two charges against Trump in the Washington election fraud case.

The court will hear the policeman’s case in its current term and could announce its ruling sometime in June, well after the scheduled March 4 start of the Washington election fraud case.

Also at issue in the cases against Trump: his claim that he can’t be prosecuted for any role in the January 6 rioting because the House of Representatives impeached him for his actions before his presidential term ended, although the Senate later acquitted him in early 2021 after he had left office.

Trump broadly contends that he can’t be prosecuted criminally now in connection with the January 6 mayhem because the Senate has already cleared him in a political proceeding.

The Supreme Court includes three justices appointed by Trump but in earlier 2020 election-related cases it has ruled against the former president.

In the election ballot cases, Trump campaign spokesman Steven Cheung said, “We have full confidence that the U.S. Supreme Court will quickly rule in our favor and finally put an end to these un-American lawsuits.”

Trump has denounced the prosecutions against him, calling Smith deranged, and saying the allegations amount to a “political witch hunt” by the Biden White House to keep him from winning the presidency again.

Smith, the Justice Department prosecutor, has also accused Trump of mishandling classified U.S. national security documents by hoarding them at his Mar-a-Lago oceanside estate in the southern state of Florida after he left the White House.

A state prosecutor in the southern state of Georgia has accused him of 2020 election fraud in that state and a New York prosecutor has accused him of falsifying business records at his family’s real estate conglomerate to hide hush money payments to a pornographic film star ahead of his successful 2016 run for the presidency.