The political world’s eyes will turn to the federal courthouse in Miami on Tuesday when former President Donald J. Trump is expected to surrender for his first appearance on charges that he illegally retained national security documents after leaving office, obstructed efforts to retrieve them and made false statements.

The extraordinary event will be the former president’s second courtroom appearance as a criminal defendant, after his arraignment in April in a New York courthouse on state charges that he falsified business records in connection with a hush-money payment to a porn star just before the 2016 election.

The authorities in Miami are bracing for protests by both supporters and opponents of Mr. Trump. Some of his backers have portrayed this indictment, in an investigation led by the semi-independent special counsel Jack Smith, as an act of war and called for retribution.

During Mr. Trump’s arraignment in New York in April, however, crowds of rival protesters outside the courthouse were raucous but peaceful.

Mr. Trump has said the hearing will be at 3 p.m. His team has been discussing security arrangements and procedures for the event with the authorities, and it is not yet clear how certain details will be handled.

Criminal defendants who are taken into custody before an initial court appearance are often handcuffed, fingerprinted and photographed for a mug shot. In April, however, authorities in New York only took Mr. Trump’s fingerprints and did not handcuff or photograph him.

It is also not yet clear which judge will oversee the hearing.

Mr. Trump’s case has been assigned to Judge Aileen M. Cannon, who earlier handled a lawsuit he filed challenging the F.B.I.’s court-authorized search of his Florida estate and club, Mar-a-Lago. That search came in August, after Mr. Trump had not fully cooperated with a subpoena requiring him to give back all the documents with classification markings that he still had.

Judge Cannon was appointed by Mr. Trump days after he lost the election in November 2020. She surprised legal experts across the ideological divide last year by intervening with various rulings favorable to Mr. Trump, disrupting the documents investigation until a conservative appeals court rebuked her, saying she never had legal authority to intervene. Her assignment to the criminal case was random, the chief clerk for the Southern District of Florida has said.

Mr. Trump never appeared before Judge Cannon during the earlier lawsuit, so if she handles Tuesday’s hearing, it would bring them face to face. But such hearings are often instead overseen by a magistrate judge. On Tuesday, that could be the magistrate who works with Judge Cannon, Bruce Reinhart — who signed the search warrant for Mar-a-Lago — or it could be whatever magistrate judge is on duty at the Miami courthouse.

At the hearing, Mr. Trump is likely to stand quietly next to his lawyer until the judge gives him permission to speak. It is also not yet clear whether Mr. Trump will return for an arraignment later or enter his expected plea of not guilty on Tuesday to eliminate a need to come back for that step.

In the search of Mar-a-Lago, agents found 102 documents marked as classified. Mr. Smith has charged Mr. Trump with 37 counts of unauthorized retention of national security information based on 36 of those documents, along with one that agents found that had no markings and laid out certain “military contingency planning.”

The indictment also details an array of evidence in support of prosecutors’ accusations that Mr. Trump knew he still had classified documents; took steps with his co-defendant, Walt Nauta, to keep them from the government even after being subpoenaed; and caused one of his lawyers to unknowingly lie to the Justice Department about the matter.

On Fox News on Sunday, William P. Barr, Mr. Trump’s former attorney general who has fallen into disfavor with Mr. Trump since refusing to falsely say the 2020 election had been stolen, said that Mr. Trump was “not a victim here.” Mr. Barr added that Mr. Trump appeared to have engaged in “egregious obstruction” to hold on to highly sensitive documents he had no right to retain.

Referring to the assessment of another conservative legal commentator, Andy McCarthy, Mr. Barr also said: “If even half of it is true, he is toast. I mean, it’s a very detailed indictment, and it’s very, very damning.”