America's Electoral College has confirmed Donald Trump's election as the 45th president of the United States, unswayed by a last-ditch bid by die-hard opponents to bar the Republican's path to the White House.

Six weeks after his upset victory over Democratic nominee Hillary Clinton, Mr Trump sailed as expected past the 270 votes needed to make his victory official, according to US media, clearing the way for him to succeed Barack Obama on 20 January.

"Congratulations to @realDonaldTrump; officially elected President of the United States today by the Electoral College!" tweeted Vice President-elect Mike Pence as the results came in.

Under normal circumstances, the Electoral College vote is a little-watched, rubber stamp formality in which electors across the country officially cast votes for the candidate that won the popular tally in their state.

This time, however, Democratic activists casting the Republican as a threat to democracy staged a vocal campaign urging Republican electors to break ranks and refuse to vote for him.

When US voters cast their ballots on 8 November, they did not directly elect the next president but rather 538 electors charged with translating their wishes into reality. 

After a deeply divisive campaign, Mr Trump won a clear majority of those electors, 306, although his Democratic rival finished nearly three million votes ahead in the popular tally.

To prevent Mr Trump from becoming president, activists needed to convince at least 37 Republican electors to abandon their candidate.

The odds of that happening were considered next to none.

According to a New York Times tally, four Democratic electors cast their votes for someone other than Clinton, and two Republicans voted for someone other than Trump.