Facebook and Twitter have flagged some of US President Donald Trump's posts on the presidential election as votes were still being counted, in a real-time test of their rules on handling misinformation and premature claims of victory.

The two companies have been under fierce scrutiny over how they police rapidly spreading false information and election-related abuses of their platforms.

In the weeks leading up to the vote, they both vowed to take action on posts by candidates trying to declare early victory.

With votes still being counted this morning, Twitter hid a Trump tweet that claimed "we are up BIG, but they are trying to STEAL the Election" behind a label that said it was potentially misleading.

The company also restricted users' ability to share the post.

Facebook added a label to the same post that said "final results may be different from initial vote counts as ballot counting will continue for days or weeks".

Twitter did not label a separate post, in which Trump said he would make a statement and added: "A big WIN!"

A spokeswoman said this was because the language was vague and unclear about what victory was being claimed.

Facebook added a notice to that post saying: "Votes are still being counted. The winner of the 2020 U.S. Presidential Election has not been projected."

A Facebook spokesman said it would run top-of-feed notifications saying the same thing on Facebook and its photo-sharing site Instagram.

Automatic labels would also start being applied to both candidates' posts with this information.

Twitter first began adding fact-checking labels to Trump's tweets in May.

Facebook, which has been criticised by some politicians and employees for not taking action on inflammatory or misleading posts from the president, has also introduced more labels around the election.

Mr Trump claimed in a speech live-streamed on both platforms that he had won the election, with millions of votes still uncounted.

His Democratic rival Joe Biden said earlier he was confident of winning the contest.

Facebook labeled the video, which already had more than 2.6 million views this morning, with a warning saying vote counting could continue for "days or weeks after the polls close".

The video had no label or warning on Twitter, where it was posted by the Trump campaign and retweeted by the president.

"Recordings or clips of the press conference on their own are not a violation of our policies," a Twitter spokeswoman said.