US President Joe Biden’s woeful performance in the presidential debate against challenger Donald Trump has re-ignited questions about what would happen should the veteran Democrat step down as party flagbearer at the last minute.

Such a high-risk political U-turn would be unprecedented in modern American election history. Here’s a look into how replacing the 81-year-old could be possible.

If a candidate leaves

To designate a formal nominee, delegates from all 50 states attend their party’s summer nominating convention to officially anoint a candidate based on primary voting.

Biden overwhelmingly won the primary votes, and the party’s roughly 3,900 delegates heading to the convention in Chicago this August are beholden to him.

If Biden exits, the delegates would have to find a replacement. That would mean bringing US politics back to the old days when party bosses jostled to pick a nominee through deal-making in smoke-filled back rooms and endless rounds of voting.

On March 31, 1968, President Lyndon Johnson made the shock announcement in the middle of the Vietnam War that he would not seek reelection.

The move turned that year’s convention, also in Chicago, into a political crisis with protesters in the street and left-leaning delegates angry at the pro-war stance of party-picked candidate Hubert Humphrey.

Following the debacle, states more widely embraced the primary process and conventions have become well-oiled affairs, whose outcomes have been known in advance since they are determined by the primaries.

If a candidate must step down after being officially nominated at the convention, a party’s formal governing body, either the Democratic National Committee or Republican National Committee, would nominate a new candidate in an extraordinary session.

Who might fill-in?

So far, the Democrats have circled the wagons around their designated nominee, at least when speaking on the record, with former president Barack Obama coming out to defend Biden.

When asked about Biden potentially stepping aside, campaign communication director Michael Tyler told reporters aboard Air Force One there were “no conversations about that whatsoever.”

A natural — but not automatic — pick to take Biden’s place would be his running mate on the 2020 ticket, Vice President Kamala Harris.

Sent in Thursday night to put out the fire after the Democratic president’s lackluster performance, the 59-year-old conceded Biden had been “slow to start” the debate but had “finished strong.”

Otherwise, any of several strong Democratic politicians — Governors Gavin Newsom of California, Gretchen Whitmer of Michigan, and Josh Shapiro of Pennsylvania are mentioned — might be called on.

Meanwhile, could a strong third-party hopeful emerge? So far, no independent candidate poses any danger to America’s dominant two-party system.

In 1992, Texas billionaire Ross Perot, who ran independently, won nearly 19 percent of the popular vote.

But in the end, because of the vagaries of the American electoral system, he did not receive a single one of the votes that matter most: those of the 538 members of the Electoral College that ultimately decide the winner.