WASHINGTON - The US Electoral College has certified Donald Trump as president of the United States, despite a last-ditch effort to deny him the White House.

Trump surpassed the 270 electoral votes needed from 538 electors casting their ballots, in a day of normally ceremonial voting that drew attention amid intense social media pressure and protests in state capitols.The Electoral College vote is normally a formality but took on extra prominence this year after a group of Democratic activists sought to persuade Republicans to cross lines and vote for Democratic nominee Hillary Clinton. She won the nationwide popular vote even as she failed to win enough state-by-state votes in the acrimonious Nov. 8 election.

“We did it!” Trump tweeted Monday evening. “Thank you to all of my great supporters, we just officially won the election (despite all of the distorted and inaccurate media).”

He later issued a statement saying: “With this historic step we can look forward to the bright future ahead. I will work hard to unite our country and be the President of all Americans.” Even one of Trump’s fiercest Republican rivals, Ohio Governor John Kasich, said it was time to get behind the president-elect.

“We want unity, we want love,” Kasich said as Ohio’s electors voted to back Trump at a statehouse ceremony. Kasich refused to endorse or even vote for Trump in the election.

With all states voting, Trump finished with 304 votes and Clinton had 227. It takes 270 Electoral College votes to win the presidency. Texas put Trump over the top, despite two Republican electors casting protest votes.Befitting an election filled with acrimony, thousands of protesters converged on state capitols across the country Monday, urging Republican electors to abandon their party’s winning candidate. More than 200 demonstrators braved freezing temperatures at Pennsylvania’s capitol, chanting, “No Trump, no KKK, no fascist USA!” and “No treason, no Trump!”

In Madison, Wisconsin, protesters shouted, cried and sang “Silent Night.” In Augusta, Maine, they banged on drums and held signs that said, “Don’t let Putin Pick Our President,” referring to Russian President Vladimir Putin.Despite the noise outside state Capitols, inside, the voting went pretty much as planned.

Electors received thousands of emails and phone calls arguing Trump is unqualified, as the first president in the nation’s history with no military or government experience and with potential conflicts of interest due to his business empire. Confirmation by the FBI and CIA that the Russian government hacked Clinton’s campaign and the Democratic National Committee seeking to help Trump win the election have amplified their calls.

Opponents would have needed 37 Republican electors to switch their votes. Even if there were a mass defection, the matter would have kicked to the Republican-led House of Representatives, which was unlikely to override their own party’s president. Further, the Republican National Committee conducted a parallel whip effort to make sure electors stick to the plan to vote for Trump. Clinton won more than 2.8 million more votes than Trump nationwide. But Trump won a majority of the 538 electoral votes - the state-by-state system created by the nation’s founders based on the size of a state’s congressional delegation.

It’s the second time in recent history, including Democrat Al Gore’s loss in 2000 to George W. Bush, that the person winning the popular vote lost the election. Before that, it hadn’t been since 1888, when Benjamin Harrison beat Grover Cleveland, that a candidate won the presidency despite losing the popular vote.

The trend is causing Democrats to question the system by which the nation chooses its leaders, according to a new USA TODAY/Suffolk University Poll. It finds 50% of registered voters believe the Electoral College should choose the president. Yet more than four in 10 - 42% - say the Constitution should be amended so the popular vote prevails in choosing the commander in chief. Liberals are most likely to want a change while conservatives want to keep the current system.

Trump assumes the mantle with an electorate deeply sceptical of his presidency, according to a new Wall Street Journal/NBC News poll. While the percentage of voters who view him positively has increased to 41%, that’s 7 points less than those who view him unfavourably. While 45% said they were optimistic and satisfied about Trump as president, it’s 21 points below Obama’s number in January 2009 and 14 points below George W. Bush’s number at the same time in 2000.

One thing Americans are united about is that Trump will bring change to Washington. Half said they approve of the way Trump is handling the transition, compared with 73% who said the same about Obama at this point. A majority of Americans are significantly bothered by reports of Russian hacking during the 2016 campaign. Yet 57% said the hacking didn’t help Trump win.

The coalition of outside groups seeking to pressure electors, calling themselves the Hamilton Electors, ran $500,000 in television ads over the weekend featuring actors including Martin Sheen and Debra Messing quoting from the Federalist Papers about the need for electors to exercise their conscience in casting their votes. Yet a POLITICO/Morning Consult poll shows 46% of voters say electors should be bound to vote for the candidate that won their state, to 34% who think electors shouldn’t be bound if they have significant concerns about the winner.

The polls also show how significantly false information has spread as Trump recently declared that he won in “a massive landslide victory.”

Half of Republicans think Trump won the popular vote, according to recent survey of 1,011 Americans conducted by Qualtrics. Trump lost the popular vote by a by a wider margin than any president in modern history. Among Republicans without college education, the share was 60%.