Donald J. Trump was indicted in Manhattan on Thursday, becoming the first American president, current or former, to be charged with a crime.

His indictment was handed up by a grand jury which has been hearing evidence about Mr. Trump for months. The Manhattan district attorney’s office, which brought the charges, is focused on the former president’s involvement in the payment of hush money to a porn star, Stormy Daniels, who said she had an affair with him. Michael D. Cohen, Mr. Trump’s fixer at the time, made the payment during the final days of the 2016 presidential campaign.

The office of the district attorney, Alvin L. Bragg, issued a statement on Thursday evening saying that Mr. Trump had been indicted, and that his lawyers had been contacted to arrange a surrender. Three people with knowledge of the matter said Mr. Trump was expected to turn himself in and face arraignment early next week, at which point the specific charges will be unsealed.

While the facts are dramatic and the indictment explosive, the case against Mr. Trump could hinge on an untested legal theory. A conviction is far from assured.

Here’s what we know, and don’t know, about the criminal case against Mr. Trump:

The charges against Mr. Trump are not yet known, though two people with knowledge of the matter said that there are more than two dozen counts in the indictment.

The charges are expected to stem from a payment that was made to Ms. Daniels, who in October 2016, during the final weeks of the presidential campaign, was trying to sell her story of an affair with Mr. Trump.

At first, Ms. Daniels’s representatives contacted The National Enquirer to offer exclusive rights to her story. David Pecker, the tabloid’s publisher and a longtime ally of Mr. Trump, had agreed to look out for potentially damaging stories about him during the 2016 campaign, and at one point even agreed to buy the story of another woman’s affair with Mr. Trump and never publish it, a practice known as “catch and kill.”

But Mr. Pecker didn’t purchase Ms. Daniels’s story. Instead, he and the tabloid’s top editor, Dylan Howard, helped broker a separate deal between Mr. Cohen and Ms. Daniels’s lawyer.

Mr. Cohen paid $130,000, and Mr. Trump later reimbursed him from the White House.

In 2018, Mr. Cohen pleaded guilty to a number of charges, including federal campaign finance crimes involving the hush money. The payment, federal prosecutors concluded, amounted to an improper donation to Mr. Trump’s campaign.

In the days after Mr. Cohen’s guilty plea, the district attorney’s office opened its own criminal investigation into the matter. While the federal prosecutors were focused on Mr. Cohen, the district attorney’s inquiry would center on Mr. Trump.

When pleading guilty in federal court, Mr. Cohen pointed the finger at his boss. It was Mr. Trump, he said, who directed him to pay off Ms. Daniels, a contention that prosecutors later corroborated.

The prosecutors also raised questions about Mr. Trump’s monthly reimbursement checks to Mr. Cohen. They said in court papers that Mr. Trump’s company “falsely accounted” for the monthly payments as legal expenses and that company records cited a retainer agreement with Mr. Cohen. Although Mr. Cohen was a lawyer, and became Mr. Trump’s personal attorney after he took office, there was no such retainer agreement and the reimbursement was unrelated to any legal services Mr. Cohen performed.

Mr. Cohen has said that Mr. Trump knew about the phony retainer agreement, an accusation that could form the basis of the case against the former president.

In New York, falsifying business records can amount to a crime, albeit a misdemeanor. To elevate the crime to a felony charge, Mr. Bragg’s prosecutors must show that Mr. Trump’s “intent to defraud” included an intent to commit or conceal a second crime.

In this case, that second crime could be a violation of election law. While hush money is not inherently illegal, the prosecutors could argue that the $130,000 payout effectively became an improper donation to Mr. Trump’s campaign, under the theory that it benefited his candidacy because it silenced Ms. Daniels.

Convicting Mr. Trump or sending him to prison could be challenging. For one thing, Mr. Trump’s lawyers are sure to attack Mr. Cohen’s credibility by citing his criminal record. Prosecutors might counter that the former fixer lied years ago on behalf of his boss at the time, and is now in the best position to detail Mr. Trump’s conduct.

The case against Mr. Trump might also hinge on an untested legal theory.

According to legal experts, New York prosecutors have never before combined the falsifying business records charge with a violation of state election law in a case involving a presidential election, or any federal campaign. Because this is uncharted territory, it is possible that a judge could throw it out or reduce the felony charge to a misdemeanor.

Even if the charge is allowed to stand, it amounts to a low-level felony. If Mr. Trump were ultimately convicted, he would face a maximum sentence of four years, though prison time would not be mandatory.

Mr. Trump responded in a statement, calling the Manhattan grand jury vote “political Persecution and Election Interference at the highest level in history.”

Mr. Trump’s statement echoed what has been an extraordinary and blistering effort to try to prevent the Manhattan district attorney, Alvin L. Bragg, from indicting him.

Still, the statement was remarkable for its aggressive tone against the prosecution, and a signal of what else may come.

“The Democrats have lied, cheated and stolen in their obsession with trying to ‘Get Trump,’ but now they’ve done the unthinkable,” he wrote. “Indicting a completely innocent person.”

Mr. Trump framed the investigation that resulted in the indictment as the latest in the long line of criminal inquiries he has faced, none of which have resulted in charges.

Mr. Trump will be fingerprinted and photographed, and will walk through the other routine steps of felony arrest processing in New York.

While it is standard for defendants arrested on felony charges to be handcuffed, it is unclear whether an exception will be made for a former president. Most defendants are cuffed behind their backs, but some white-collar defendants deemed to pose less danger have their hands secured in front of them.

Mr. Trump will almost certainly be accompanied at every step — from the moment he is taken into custody until his appearance before a judge in Lower Manhattan’s imposing Criminal Courts Building — by armed agents of the U.S. Secret Service. They are required by law to protect him at all times.

Security in the courthouse is provided by state court officers, with whom the Secret Service has worked in the past. But the chief spokesman for the federal agency, Anthony J. Guglielmi, said he could not comment on measures that would be put in place for Mr. Trump.

Lawyers for Mr. Trump, who is running for president a third time, said late Thursday that he will surrender, and he is expected to be arraigned on Tuesday.

After he is arraigned, he is almost certain to be released on his own recognizance, because the indictment will likely contain only nonviolent felony charges; under New York law, prosecutors cannot request that a defendant be held on bail in such cases.