Donald Trump threatened to drag the US election process into the courts as his contest with Joe Biden came down to the outcomes in a handful of battleground states.
The Republican incumbent falsely claimed he had won and warned of a "fraud on the American nation" as he vowed to go to the US Supreme Court to get vote counting stopped.
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".
The Democratic challenger has long anticipated an attempt by Mr Trump to cast doubt on the results, particularly due to the high level of advance voting this year.
Mr Trump said: "This is a fraud on the American public, this is an embarrassment to our country.
"We were getting ready to win this election – frankly we did win this election.
"So our goal now is to ensure the integrity for the good of this nation. This is a very big moment.
"We want the law to be used in a proper manner. So we will be going to the US Supreme Court, we want all voting to stop."
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 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.
After a divisive election campaign overshadowed by the complexities of voting during the coronavirus pandemic, Mr Biden's 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 manager Jen O'Malley Dillon said: "If the president makes good on his threat to go to court to try to prevent the proper tabulation of votes, we have legal teams standing by ready to deploy to resist that effort.
"And they will prevail."
Neither candidate has achieved the 270 electoral college votes necessary for victory and counting is still under way in key battleground states including Wisconsin, Michigan, Pennsylvania and Georgia.
Mr Trump continued complaining about the election process as a late burst of votes in Michigan and Wisconsin gave Mr Biden a small lead in the key contests.
Last night I was leading, often solidly, in many key States, in almost all instances Democrat run & controlled. Then, one by one, they started to magically disappear as surprise ballot dumps were counted. VERY STRANGE, and the "pollsters" got it completely & historically wrong!
— Donald J. Trump (@realDonaldTrump) November 4, 2020
The president said on Twitter: "Last night I was leading, often solidly, in many key States, in almost all instances Democrat run & controlled. Then, one by one, they started to magically disappear as surprise ballot dumps were counted. VERY STRANGE, and the 'pollsters' got it completely & historically wrong!"
Mr Biden has 238 expected electoral college votes to Mr Trump's 213.
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 Trump, however, has seized major victories in the key bellwethers of Florida and Ohio, which both have long records of choosing the winner of the White House.
Former vice president Mr Biden won Arizona, a state that has only backed a Democrat in the race once in 72 years.
Earlier in the fraught night, Mr Biden took to a stage in Delaware to say "we believe we're on track to win this election", but called for patience and stressed that: "It ain't over until every vote is counted."
The UK-US relationship is in great shape and we are confident it will go from strength to strength whichever candidate wins the election. Across trade, security, intelligence, defence, innovation and culture, no two countries do more together. (2/2)
— Dominic Raab (@DominicRaab) November 4, 2020
Florida's 29 electoral college votes were a must-win for Mr Trump to reach the 270 required for victory, with no Republican having won the White House without the Sunshine State's support since 1924.
It has backed the winner in every election since 1996 and has only gone with the losing candidate twice since 1928.
Ohio is also a significant victory for Mr Trump, having been key to his chances of remaining in the White House, and whoever has won the state has gone on to take the presidency since 1964.
Mr Trump held on to Texas in a fiercely-contested battle and claimed the swing states of Ohio and Iowa, while Mr Biden won modest victories in Minnesota and New Hampshire.
Mr Biden has 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.
Economic fairness and racial justice have been key issues in the election race. Both men have also clashed over the Covid-19 response as the nation reels from more than 230,000 coronavirus deaths and millions of job losses.
Steady queues of voters flocked to the polls on Tuesday after around 100 million Americans voted early, setting the nation on course for a record turnout figure.
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 country, 270 is the winning number – a target which remains within reach for either candidate, depending on how the results unfold over the coming hours and days.
In the UK, Boris Johnson refused to criticise Mr Trump's actions, telling MPs: "We don't comment as a UK Government on the democratic processes of our friends and allies."
Foreign Secretary Dominic Raab said it was "important the process is given sufficient time to reach a conclusion".