Media playback is unsupported on your device Media caption 'I will be president for all Americans'

Donald Trump will become the 45th US president after a stunning victory over Democrat Hillary Clinton.

The Republican said he would serve all Americans and called for the country to unite, following a divisive campaign which saw him beset by controversies.

Hillary Clinton is due to appear in New York for her first public statement since conceding to Mr Trump in a telephone call on Tuesday evening.

Outgoing President Barack Obama has congratulated his successor by phone.

Mr Obama invited Mr Trump to a meeting at the White House on Thursday to discuss the transition.

Image copyright Twitter Image caption Donald Trump has already changed his Twitter bio to "President-elect of the United States"

Image copyright AP Image caption Trump supporters enjoy election coverage in New York

When Mr Trump is sworn in as president in January, he will have the benefit of a Republican majority in both houses of Congress, as the party unexpectedly retained control of both the Senate and the House of Representatives.

The Republican nominee defied pre-election polling to claim swing states, winning the key battlegrounds of Florida, Ohio and Pennsylvania.

The president-elect told cheering supporters that Americans must now "bind the wounds of division", after a gruelling, acrimonious electoral battle.

"I want to tell the world community that while we will always put America's interests first, we will deal fairly with everyone," he said.

Global markets fell sharply at the news, but later recovered.

House Speaker Paul Ryan paid tribute to his fellow Republican, saying he had "turned politics on its head" and would lead a unified Republican government.

Around the world, leaders and the media have been reacting to America's election upset:

Germany's foreign minister said the outcome would make things "more difficult', with US foreign policy "less predictable"

Russian President Vladimir Putin - for whom Mr Trump has voiced support but who Democrats accused of election meddling - said he hoped ties could improve from their current "critical condition"

The European Union said close co-operation with the US was the only way to deal with "unprecedented challenges" around the world

British Prime Minister Theresa May said the UK and the US had an "enduring and special relationship" and would remain close partners on trade, security and defence

'United people'

While US media report that Mrs Clinton is slightly ahead in the popular vote, in the US electoral college system which determines the presidency, what matters is winning individual states.

As poll counting went late into the night, it was Mr Trump's shock victory in Wisconsin that put him over the 270 out of 538 electoral college votes needed to win the White House.

Minutes after Mrs Clinton called him to concede, the US president-elect took to the stage with his family at his victory rally in a New York hotel ballroom and paid tribute to his rival.

Media playback is unsupported on your device Media caption Trump: Hopes and fears of campaigners

"Hillary has worked very long and very hard over a long period of time, and we owe her a major debt of gratitude for her service to our country."

He called for Americans to "come together as one united people" and pledged to be president "for all Americans", after a campaign that saw him hit out at Muslims, Hispanics and other minority groups.

'Popular revolution': By Anthony Zurcher, BBC News, Washington

Donald Trump defied all expectations from the very start of his presidential campaign more than a year ago.

Very few people thought he would actually run. He did. They thought he wouldn't climb in the polls. He did. They said he wouldn't win any primaries. He did. They said he could never overcome resistance from the Republican establishment and win his party's nomination. He did.

Finally, they said there was no way he could compete for, let alone win, a general election match-up with Hillary Clinton. Now he's President-elect Trump.

He staged the most unconventional of campaigns, running on gut instinct and his trademark bombast when others - both within his own party and outside - counselled moderation and a pivot to positions perceived to be more acceptable to mainstream voters.

He stayed true to the methods and tactics that got him to the cusp of the presidency, and in the end he was rewarded for it.

Down the stretch Mr Trump boasted that he was leading a movement, riding the crest of a popular revolution that would change the face of American politics. He was right.

Mr Trump has so far won 28 US states. Mrs Clinton, 69, has only notched up victories in 18 US states and the District of Columbia.

New Hampshire and Michigan remained too close to call as of Wednesday morning.

Mr Trump held solidly Republican territory, despite vigorous Democrat campaigning in states such as Georgia, Arizona and Utah, and achieved major upsets in swing states, winning Pennsylvania and Wisconsin, states that have not supported a Republican presidential candidate since 1988 and 1984 respectively.

At 70, the billionaire will be the oldest first-term president in US history.

How Donald Trump won the presidency Democrat Republican Other Undeclared Your browser does not support this interactive content. You must be using a modern browser with Javascript enabled to view our results maps.

How Trump won in maps

Image copyright AP Image caption There were glum scenes at the Clinton campaign's planned victory rally in New York

Mrs Clinton, who dreamed of becoming the first female US president, did not appear at what was meant to be her victory rally in Manhattan.

Mr Trump provoked controversy on the campaign trail for comments about women, Muslims and a plan to build a wall along the US-Mexican border.

He fired up white, working-class American voters who were angry at the Washington establishment and felt left behind by globalisation.

Media playback is unsupported on your device Media caption US election: Relive the wild ride in 170 seconds

Mrs Clinton - who held a slim lead in opinion polls going into the vote - saw her campaign dogged by FBI investigations into her use of a private email server as US secretary of state. Last Sunday, the FBI cleared her once again of any criminality.

Mr Trump's campaign manager Kellyanne Conway told CNN that Mr Trump had not discussed the issue of prosecuting Mrs Clinton in her concession phone call.

Polls showed she won support from female, African American and Hispanic voters, while Mr Trump scored well with male and white voters.

In a separate development, Massachusetts, Nevada and California voted to legalise recreational marijuana, which could lead to the creation of the largest market for marijuana products in the US.