Hunter Biden, son of U.S. President Joe Biden departs the J. Caleb Boggs Federal Building on June 03, 2024 in Wilmington, Del. (Anna Moneymaker/Getty Images)

(LOS ANGELES) -- After hours of legal wrangling on Thursday, Hunter Biden pleaded guilty to nine tax-related charges in a last-minute bid to avoid a lengthy and potentially embarrassing trial, abandoning an earlier proposal to plead guilty while maintaining his innocence on the underlying conduct.

U.S. Judge Mark Scarsi accepted Hunter Biden's guilty plea to his nine-count tax case. Sentencing in the case is scheduled for Dec. 16.

Scarsi clarified that Hunter Biden faces a maximum sentence of 17 years in prison and a fine of as much as $1.35 million.

"Do you agree that you committed every element of every crime alleged…in the indictment?" Judge Scarsi asked.

"Yes," Hunter Biden said before pleading guilty to each count of the indictment.

It was perhaps the most stunning twist in a legal drama that has for years been defined by unexpected turns – and immediately raised the specter of a presidential pardon, despite President Joe Biden's previous assurance that he would not grant his son clemency.

Prosecutors accused Hunter Biden in December of engaging in a four-year scheme to avoid paying $1.4 million in taxes while spending hundreds of thousands of dollars on exotic cars, clothing, escorts, drugs and luxury hotels.

Hunter Biden had originally pleaded not guilty to a nine-count indictment that includes six misdemeanor charges of failure to pay, plus a felony tax evasion charge and two felony charges of filing false returns.

But on Thursday, just moments before prospective jurors were to be summoned into the Los Angeles courtroom where his trial was scheduled to begin, Abbe Lowell, an attorney for Hunter Biden, announced his intention to submit a so-called "Alford plea," which would allow Hunter Biden to plead guilty on all counts but preclude him from acknowledging guilt on the underlying conduct.

When prosecutors opposed that path – and Judge Scarsi expressed some hesitation in granting it – attorneys for Hunter Biden said he would enter a traditional guilty plea.

"Mr. Biden is prepared to proceed today and finish this," Lowell said Thursday afternoon in court.

In pleading guilty to the tax charges, Hunter Biden managed to avoid what was expected to be a grueling and potentially embarrassing weekslong trial, during which prosecutors had planned to examine interludes from his time suffering drug addiction and his overseas business ventures.

Attorneys in special counsel David Weiss' office had planned to introduce more than two dozen witnesses, including Hunter Biden's ex-wife and her sister.

Dressed in a dark suit and thick-rimmed glasses, Hunter Biden on Thursday addressed the court to acknowledge that he understood the potential consequences of a guilty plea. His voice showed little emotion and he occasionally glanced into the gallery, where his wife, Melissa Cohen Biden, was seated.

Prosecutor Leo Wise, who earlier in the day called the Alford plea proposal "an injustice," then read the entire 56-page indictment aloud in court to establish a factual record.

Thursday's court appearance comes three months after Hunter Biden was convicted by a Delaware jury on three felony charges related to his purchase of a firearm in 2018 while allegedly addicted to drugs. His sentencing in that case is scheduled for Nov. 13.

What did prosecutors allege?

In their 56-page indictment, prosecutors alleged that Hunter Biden willfully avoided paying taxes by subverting his company's own payroll system, that he failed to pay his taxes on time despite having the money to do so, and that he included false information in his 2018 tax returns.

"[T]he defendant spent this money on drugs, escorts and girlfriends, luxury hotels and rental properties, exotic cars, clothing, and other items of a personal nature, in short, everything but his taxes," the indictment alleged.

Prosecutors also highlighted millions of dollars that Hunter Biden received from overseas business in Ukraine, China, and Romania in exchange for "almost no work."

Although Hunter Biden eventually paid back all his back taxes and penalties with the help of a third party -- identified by ABC News as Hunter Biden confidant Kevin Morris -- Judge Scarsi blocked defense attorneys from introducing that information to the jury.

"Evidence of late payment here is irrelevant to Mr. Biden's state of mind at the time he allegedly committed the charged crimes," Scarsi wrote in an order last week.

Last June, Hunter Biden agreed to plead guilty to two misdemeanor offenses, acknowledging that he failed to pay taxes on income he received in 2017 and 2018. The deal also allowed him to enter into a pretrial diversion agreement to avoid criminal charges related to his 2018 firearm purchase.

Had the deal worked out, Hunter Biden would have likely faced probation for the tax offenses and had his gun charge dropped if he adhered to the terms of his diversion agreement.

However, the plea deal fell apart during a contentious hearing before U.S. District Judge Maryellen Noreika, who took issue with the structure of the deal.

By September, the special counsel had unsealed an indictment in Delaware charging Hunter Biden for lying on a federal form when he purchased a firearm in 2018.

The federal indictment in Los Angeles for the tax crimes followed in December.

ABC News' Olivia Rubin contributed to this report.

Copyright © 2024, ABC Audio. All rights reserved.