Donald Trump has been charged with 34 crimes over alleged hush-money payments made on his behalf to the former adult film star Stormy Daniels during his 2016 presidential campaign.
The former president has denied the allegations and is the first-ever case brought against a former US president.
Mr Trump was indicted last week and was charged on Tuesday after he surrendered to authorities.
So what happens next?
What is an indictment?
An indictment is a formal written accusation that a person has committed a crime. These often involve felony charges - crimes punishable by a prison term of one year or more.
The indictment, the result of a secret vote by a grand jury, a group of citizens who decide if there is enough evidence to charge a person with a crime, is used to inform an accused person about the charges that have been brought against them.
If defendants are notified of an indictment or an impending arrest, they often arrange to turn themselves in.
This can help smooth the process and strengthen arguments for bail by showing that they aren’t evading the case.
What happened on Tuesday?
Donald Trump surrendered to the Secret Service on Tuesday, receiving an escort to a New York courtroom.
He was fingerprinted on arrival but it is not believed a mugshot was taken of him.
Mr Trump was also not handcuffed when he entered the court, which is sometimes the case in the US.
Basic details such as name and birthday were also collected.
The former US president pumped his fist as he exited Trump Tower before he travelled in an eight-car motorcade to the courthouse
A lot can happen when the defendant is being recorded by the court with much depending on the severity of the crime.
However, there was no precedent for booking an ex-president with US Secret Service protection - who would need to be by his side for his safety.
The New York court had no one else to process when Mr Trump was in the building, making the process speedier than usual, most likely on purpose.
Mr Trump was then brought before a judge where the charges against him were presented.
Prosecutors raised concerns about what they said were irresponsible social media posts they said targeted people in the case, including grand jury witnesses and District Attorney Alvin Bragg. They specifically pointed to posts Trump made that warned of “potential death and destruction” if he were to be indicted.
The judge said he was not imposing a gag order at this point but asked both sides to refrain from making comments or engaging in comments that could lead to civil unrest.
Mr Trump only spoke to plead not guilty, with the whole proceeding lasting just over an hour.
What happens next?
Mr Trump is next due in court on December 4. His lawyers asked for him to be excused from attending the hearing in person because of the extraordinary security measures.
The trial could last a long time, with proper proceedings not getting underway for at least a year.
This means he could face a jury in a Manhattan courtroom during or even after the 2024 presidential campaign.
Over the first three quarters of 2022 in Manhattan, the average criminal case took over 900 days to pass from indictment to a trial verdict, according to analysis of data from the state's division of criminal justice services, as reported by Reuters.
An indictment - or even a conviction - would not bar Trump from running for president or serving as the Republican nominee.
Why has Donald Trump been indicted?
Late in the 2016 presidential campaign, Trump's then-lawyer and fixer Michael Cohen paid former porn star Stormy Daniels US $130,000 (£105,000) to keep her silent about what she claims was a sexual encounter with Mr Trump a decade earlier after they met at a celebrity golf tournament.
Mr Cohen was then reimbursed by Mr Trump’s company, the Trump Organization, which also rewarded the lawyer with bonuses and extra payments logged internally as legal expenses.
Over several months, Mr Cohen said, the company paid him $420,000 (£339,000).
Earlier in 2016, Mr Cohen had also arranged for the publisher of the tabloid the National Enquirer to pay Playboy model Karen McDougal $150,000 (£121,000) to spike her story of a Trump affair in a controversial practice known as “catch-and-kill.”
The payments to the women were intended to buy secrecy, but they backfired almost immediately as details of the arrangements leaked to the news media.
Federal prosecutors in New York ultimately charged Mr Cohen in 2018 with violating federal campaign finance laws, arguing that the payments amounted to impermissible help to Mr Trump’s presidential campaign.
Mr Cohen pleaded guilty to those charges and unrelated tax evasion counts and served time in federal prison.
Mr Trump was implicated in court filings as having knowledge of the arrangements, but US prosecutors at the time baulked at bringing charges against him.
The Justice Department has a long-time policy that it is likely unconstitutional to prosecute a sitting president in federal court.
The charges against Mr Trump are being brought by Manhattan district attorney, Mr Bragg. His predecessor, Cyrus Vance Jr, had taken up the investigation back in 2019.
After Mr Trump's court appearance, Mr Bragg warned "no matter who you are, we cannot and will not normalise serious criminal conduct."
"Under New York State law, it is a felony to falsify business records with intent to defraud and intent to conceal another crime. That is exactly what this case is about: 34 false statements made to cover up other crimes," he added.
While that probe initially focused on the hush money payments, Mr Vance’s prosecutors moved on to other matters, including an examination of Mr Trump’s business dealings and tax strategies.
Mr Vance ultimately charged the Trump Organization and its chief financial officer with tax fraud related to fringe benefits paid to some of the company’s top executives.
After the Trump Organization was convicted on the tax fraud charges in December, Mr Bragg renewed focus on the hush money case, and convened a new grand jury.
Mr Trump denies wrongdoing, and the affair, saying the indictment is "political persecution".
What other legal challenges does Mr Trump face?
In addition to the hush money probe in New York, Mr Trump faces separate investigations in Atlanta and Washington over his efforts to undo the results of the 2020 election.
A Justice Department special counsel has also been presenting evidence before a grand jury investigating Mr Trump’s possession of hundreds of classified documents at his Florida estate.
It is not clear when those investigations will end or whether they might result in criminal charges, but they will continue regardless of what happens in New York, underscoring the ongoing gravity of the legal challenges confronting the former president.
Want a quick and expert briefing on the biggest news stories? Listen to our latest podcasts to find out What You Need To Know