Donald Trump has stunned America and the world, riding a wave of populist resentment to defeat Hillary Clinton in the race to become the 45th president of the United States.

The Republican mogul defeated his Democratic rival, plunging global markets into turmoil and casting the long-standing global political order, which hinges on Washington's leadership, into doubt.

"Now it is time for America to bind the wounds of division," Trump told a crowd of jubilant supporters in the early hours of Wednesday in New York.

"I pledge to every citizen of our land that I will be president for all Americans."

During a bitter two-year campaign that tugged at America's democratic fabric, the bombastic tycoon pledged to deport illegal immigrants, ban Muslims from the country and tear up free trade deals.

His message appears to have been embraced by much of America's white majority, disgruntled by the breath and scope of social change and economic change in the last eight years under their first black president, Barack Obama.

Trump openly courted Russian leader Vladimir Putin, called US support for NATO allies in Europe into question and suggested that South Korea and Japan should develop their own nuclear weapons.

The businessman turned TV star turned-politico -- who has never before held elected office -- will become commander-in-chief of the world's sole true superpower on January 20.

The results prompted a global market sell-off, with stocks plunging across Asia and Europe and billions being wiped off the value of investments.

Although he has no government experience and in recent years has spent as much time running beauty pageants and starring in reality television as he had building his property empire, Trump at 70 will be the oldest man to ever become president.

Yet, during his improbable rise, Trump has constantly proved the pundits and received political wisdom wrong.

Opposed by the entire senior hierarchy of his own Republican Party, he trounced more than a dozen better-funded and more experienced rivals in the party primary.

During the race, he was forced to ride out allegations of sexual assault and was embarrassed but apparently not shamed to have been caught on tape boasting about groping women.

And, unique in modern US political history, he refused to release his tax returns.

But the biggest upset came on Tuesday, as he swept to victory through a series of hard-fought wins in battleground states from Florida to Ohio.

Legacy of Ashes

Clinton had been widely assumed to be on course to enter the history books as the first woman to become president in America's 240-year existence.

Americans have repudiated her call for unity amid the United States' wide cultural and racial diversity, opting instead for a leader who insisted the country is broken and that "I alone can fix it."

If early results hold out, Trump's party will have full control of Congress and he will be able to appoint a ninth Supreme Court justice to a vacant seat on the bench, deciding the balance of the body.

So great was the shock that Clinton did not come out to her supporters' poll-watching party to concede defeat, but instead called Trump and sent her campaign chairman to insist in vain the result was too close to call.

"I want every person in this hall to know, and I want every person across the country who supported Hillary to know that your voices and your enthusiasm mean so much to her and to him and to all of us. We are so proud of you. And we are so proud of her," chairman John Podesta told shell-shocked supporters.

The election result was also a brutal humiliation for the White House incumbent, Obama, who for eight years has repeated the credo that there is no black or white America, only the United States of America.

On the eve of the election, he told tens of thousands of people in Philadelphia that he was betting on the decency of the American people.

"I'm betting that tomorrow, most moms and dads across America won't cast their vote for someone who denigrates their daughters," Obama said.

"I'm betting that tomorrow, true conservatives won't cast their vote for somebody with no regard for the Constitution," he added.

His bet appears to have been flat out wrong, and America's first black president will be succeeded by a candidate who received the endorsement -- albeit unsought and unacknowledged -- of the white supremacist Ku Klux Klan.

Trump's shock victory is just the latest evidence that globalization has eroded faith in liberal political leadership.

From Britain's vote to leave the European Union to the rise of far right populists and nationalists in continental Europe, opposition to open trade and social and racial tensions are on the rise.