Joe Biden was just one battleground state away from securing enough electoral college votes to achieve what he called a ‘victory for the American people’ early on Thursday, as Donald Trump pursues legal avenues to the White House.

After securing victories in Wisconsin and Michigan, the Democrat needed to secure one of Georgia, Nevada, North Carolina or his home state Pennsylvania to reach the necessary 270 votes to claim the country’s top position.

Mr Trump, however, must win all four states, and has begun legal action in three of them to either stop the counting of votes or insist his team be provided greater access to scrutinise the process.

The president had earlier falsely claimed victory and threatened to go to the US Supreme Court, as he warned a “fraud on the American nation” was being carried out over the way votes were being counted.

Mr Biden’s campaign said the president’s extraordinary comments, made in the White House against a backdrop of US flags, were a “naked attempt to take away the democratic rights of American citizens”.

Mr Trump said Tuesday’s election, which was characterised by a high number of mail-in and early votes, in part due to the coronavirus crisis, had been “an embarrassment to our country”.

“We were getting ready to win this election – frankly we did win this election,” Mr Trump said.

The president announced that “we will be going to the US Supreme Court, we want all voting to stop”.

Later on Wednesday he claimed that it was “very strange” that “surprise ballot dumps” had eroded his overnight lead in key states.

“How come every time they count mail-in ballot dumps they are so devastating in their percentage and power of destruction?” he said.

Mr Trump’s campaign requested a recount in Wisconsin, in addition to filing lawsuits in Pennsylvania and Michigan seeking to pause the vote count in those key battleground states.

His campaign also filed suit in Georgia, asking for a judge to order election officials there to follow the law on storing and counting absentee ballots.

In the UK, Prime Minister Boris Johnson refused to criticise Mr Trump’s actions in threatening court action, telling MPs: “We don’t comment as a UK Government on the democratic processes of our friends and allies.”

Mr Trump has nominated three of the Supreme Court’s nine justices – including, controversially, Amy Coney Barrett, whose appointment was confirmed just a week before the election.

It is unclear what, if any, legal basis the president would have, with Mr Biden’s camp insisting that the law required every “duly cast vote” to be counted.

Mr Biden said: “We won’t rest until everyone’s vote is counted.”

His campaign had been braced for Mr Trump to seize on record numbers of postal votes to allege he was being cheated.

Mr Biden’s campaign chief Jen O’Malley Dillon said the Democrat was on a “clear path to victory” and would “garner more votes than any presidential candidate in history”.

Among the remaining undeclared states, Georgia is a “toss-up” and North Carolina is “really tight” but “probably leaning towards Trump right now”.

Ms O’Malley Dillon said: “Last night the president of the United States falsely claimed that he had won this race and then demanded that votes stop being counted.

“The American people get to pick their president, the president does not get to pick the people whose votes get counted.”Further results in Nevada, where the two candidates are neck and neck, will not be announced until Thursday, leaving six college votes up for grabs.

Mr Biden has himself painted the election as the “battle for the soul” of the nation, saying democracy itself is at stake. Mr Trump reprised his “Make America Great Again” mantra during the bitter campaign.

Each state gets a number of electoral college votes roughly in line with its population and they largely hand them all to the winner in that state. With 538 up for grabs across the States, 270 is the key number to win the presidency.

But the election night itself looked unlikely to reveal the definite answer many want with results as close as they were.

Mr Trump had already jeopardised the likelihood of a simple race by refusing to commit to a peaceful transition of power and having warned of a “rigged election”.

Along with his attacks, which have largely centred on unfounded claims over postal voting, he has threatened to challenge the result in the courts if it is not in his favour.

Mr Biden will await the results in his hometown of Wilmington, Delaware, whereas the president has invited hundreds of supporters to an election party inside the White House.