AS Joe Biden closed in on what seemed to be certain victory last night, President Donald Trump threw the US election into even more chaos when he launched a series of court actions to stop his opponent ousting him.

As the National went to press, Biden was on the cusp of victory, needing either Nevada or Pennsylvania to declare for him.

The former vice-president is leading Nevada with votes still being counted and is catching up fast in Pennsylvania, where officials reported an avalanche of late votes for Biden from mail-in ballots.

News that the final votes won’t be tallied until possibly next Tuesday came on a day when an increasing number of Americans, including politicians and pundits, expressed fears for the future of American democracy.

There are worries there will be violence on the streets before the contest is actually over, something that looks more and more likely to be settled in the Supreme Court where three of the nine justices were selected by Trump.

READ MORE: Where now for the land of the free as Trump tramples US democracy?

Trump carried out a long and rancorous campaign attacking the integrity of the voting system, and he and his cohorts have again alleged voting fraud. But in every claim or allegation, the Trump team has failed to provide any proper evidence.

Trump got an early setback in court, with a judge in Michigan dismissing the campaign’s lawsuit to stop counting postal ballots in the state.

Judge Cynthia Stephens of the state’s first district appeals court said that the campaign filed the request too late – just hours before counting wrapped up – and that the suit was brought against the wrong individual (the secretary of state). The official does not have control over the local counting process, the judge said.

Trump also started legal action against Georgia to halt the vote count there. His campaign said a Republican poll observer in the southern state had witnessed 53 late absentee ballots being illegally added to a pile of votes in Chatham County. Again, the state court dismissed the lawsuit yesterday.

The president’s campaign was arguing that counts should stop until more Republican poll watchers could observe the counting process.

The Trump campaign did win a Pennsylvania court order to allow observers nearer to the count, but that was then overturned by the state’s supreme court. The Republican Party of Nevada has also said it will file a suit claiming widespread voting irregularities – and that was before the result was even known.

There will be a recount in Wisconsin, as demanded by Trump, but officials there are confident that the result is robust.

If the Trump campaign’s frantic efforts to keep him in power were not so serious a threat to American democracy, they would be almost laughable. At one stage, his supporters were chanting “stop the count” in the states where he was leading, while in another state where he was losing, his fans chanted “count every vote”.

The court actions by the Trump campaign have also sickened even members of his Republican Party. After the president tweeted “stop the count”, Republican former New Jersey governor Chris Christie said on ABC News: “There’s just no basis to make that argument tonight. There just isn’t. All these votes have to be counted that are in now.

“You have to let the process play itself out before you judge it to be flawed. And by prematurely doing this, if there is a flaw later, he has undercut his own credibility. So I think it’s a bad strategic decision, it’s a bad political decision, and it’s not the kind of decision you would expect someone to make tonight who holds the position he holds.”

At one point, Trump supporters’ actions almost went from intimidation and bullying to outright armed confrontation. A so-called militia man armed with assault weapons was pictured outside a counting station in Detroit, Michigan.

Though clashes were not all inspired by Trump fans. More than 600 anti-Trump marchers were arrested after blocking traffic on I-94 in downtown Minneapolis, Minnesota. Earlier, several dozen protesters set off fireworks and spray-painted business storefronts, leading to 14 arrests.

The usual trolling on social media became increasingly ugly and showed how deep the divisions have become. The BBC’s Marianna Spring reported that “a huge viral Facebook group spreading unsubstantiated claims that there is a Democratic Party plot to ‘steal’ the election has been removed by the social media firm”.

Comments on the Facebook group page included threats of violence and calls for civil war and revolution.

The group “Stop the Steal” was set up on Tuesday and had more than 330,000 members before it was taken down.

Posts called for its members to take to the streets in the event that Joe Biden is declared the next US president.

READ MORE: Result of US election will have huge implications for an independent Scotland

Springs reported: “Dozens of comments went much further and encouraged people to take up arms or even shoot their political opponents. Some threatened rioting and looting.

The group taken down by Facebook was by far the largest of a handful of “Stop the Steal” forums set up since election day.

On Tuesday, a “#StoptheSteal” label gained a bit of popularity on Twitter, including baseless and misleading claims of voter fraud and dirty tricks.

Facebook said it removed the group “in line with the exceptional measures that we are taking during this period of heightened tension”.

It also said the group “was organised around the delegitimisation of the election process”.

Last night, Biden’s camp launched a crowdfunder in anticipation of meeting Trump’s challenges in court – all the way to the Supreme Court if necessary.

They stated: “Your donation right now is absolutely critical to electing Joe, Kamala, and Democrats across the country, and we’re counting on a surge of donations to fund all that we need to accomplish.”

There may be a result finally announced today, but this contest appears to be far from over.