The US electoral college has certified Donald Trump as president, despite a last-ditch effort to deny him the White House.
Six weeks after winning the polls, the Republican has secured the 270 votes needed to formalise his victory.
Reacting to his win, Mr Trump promised to "work hard to unite our country and be the president of all Americans".
Electors had been flooded with emails and phone calls urging them not to support the billionaire.
The voting process is usually a formality, but was clouded this year by claims that Russian hackers tried to sway the presidential election.
Texas ultimately put the president-elect over the 270 threshold, despite two of its electors voting against him.
The New York Times reports that four Democratic electors also cast their votes for someone other than Mrs Clinton.
The result will be officially announced on 6 January in a special joint session of Congress.
"I thank the American people for their overwhelming vote to elect me as their next president of the United States," Mr Trump said in a statement after the result came in.
"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," he added.
Vice president-elect Mike Pence hailed his boss on Twitter, writing: "Congratulations to @realDonaldTrump; officially elected President of the United States today by the Electoral College."
He added that he was "honored & humbled to be officially elected today as the next Vice President of the United States of America" - drawing thousands of "likes" and retweets.
The movement to block Mr Trump had fought hard to convince Republican electors to abandon their party's candidate.
Millions of Americans signed an online petition to that effect, while thousands of anti-Trump protesters gathered at state capitols across
In Maine, protesters beat drums and waved signs saying, "Don't let Putin Pick Our President," - a reference to allegations that Kremlin-backed hackers tried to sway the election in Mr Trump's favour.
Numerically, Mr Trump's opponents never stood much chance. To keep him out of the Oval Office, 38 Republican electors would have had to defect.
Even that would probably only have delayed the inevitable.
If no candidate reaches 270 in the electoral college, the House of Representatives must vote on the next president, and the Republican-controlled chamber would most likely have chosen Mr Trump.
How does the electoral college work?
It was set up by America's founding fathers as a compromise between allowing Congress and the people to elect the president.
Technically, Americans cast votes on election day for electors, not the candidates themselves.
Mr Trump won the majority of these electors - 306 - although Democrat Hillary Clinton secured almost 3 million more votes from the public.
As a result, he won the election.
What is the US electoral college?
The electors are mostly elected officials or party functionaries, and are generally unknown to the public.
There are 538 in all, one for each member of Congress. A candidate needs to take at least 270 electoral votes - half of the total plus one - to win the White House.
In November's presidential election, Mr Trump's 306 electors came from 30 states.
Under US law, electors must formally vote for the president and vice-president before they can lead the country.
Mr Trump is scheduled to take office on 20 January.