US President Donald Trump and Democratic rival Joe Biden are assembling armies of powerful lawyers for the possibility the race for the White House is decided not at the ballot box but in court.
The opposing campaigns have been engaging in a lawyer's version of tabletop war games, churning out draft pleadings, briefs and memos to cover a range of legal scenarios.
Attorneys for the Republicans and the Democrats are already clashing in courts across the US over mailed-in ballot deadlines and other issues brought on by the coronavirus pandemic.
And as Trump tries to sow doubt about the legitimacy of the November 3 election, both sides have built massive legal operations readying for a bitterly disputed race that lands at the Supreme Court.
"We've been preparing for this for well over a year," Republican National Committee chief counsel Justin Riemer told The Associated Press.
"We've been working with the campaign on our strategy for recount preparation, for election day operations and our litigation strategy."
On the Democratic side, the Biden campaign's election protection programme includes a special national litigation team involving hundreds of lawyers led by Walter Dellinger, acting solicitor general in the Clinton administration, and Donald Verrilli, a solicitor general under President Barack Obama, among others.
Bob Bauer, a former White House counsel to Obama, and Biden campaign general counsel Dana Remus are focused on protecting the rights of voters, who have been enduring long lines at polling places around the country on the belief the presidential election will be decided by their ballots.
Both sides are informed by the experience of the 2000 election, which was ultimately decided by the Supreme Court in Bush v Gore.
But this year, because Trump has pushed unsubstantiated claims about the potential for voter fraud with increased voting by mail, sowing doubt about the integrity of the result, lawyers are preparing for a return trip before the high court.
And, in an extraordinary twist, Trump has pushed for his nominee to the Supreme Court, Judge Amy Coney Barrett, to be seated as soon as possible if she is confirmed as expected on Monday (Tuesday NZT), saying it's important to have a ninth justice to decide any election disputes.
The race is already thought to be the most litigated in American history, with some 260 lawsuits arising from the coronavirus by one tally.
Behind the scenes, Trump and Republicans have been putting together a legal team that includes Jay Sekulow, one of the president's lead attorneys during the impeachment trial and the special counsel's Russia investigation and an experienced litigator before the Supreme Court.
Republicans have hired dozens of attorneys and retained prominent national firms to challenge Democratic efforts to expand ballot access in key battleground states.