World leaders are reacting to the triumph of Donald Trump over Hillary Clinton in the US presidential election.
As news of the result was confirmed, they began to send congratulations - some fulsome, some more tentative - to the business mogul.
President Vladimir Putin has said he is willing fully to restore ties with the US following Mr Trump's victory.
"We heard the campaign statements of the future US presidential candidate about the restoration of relations between Russia and the United States," Mr Putin said on Wednesday.
"It is not an easy path, but we are ready to do our part and do everything to return Russian and American relations to a stable path of development.
"This would be good for both the Russian and American people and have a positive impact on the climate of world affairs."
In Moscow meanwhile senior nationalist MP Vladimir Zhirinovsky threw a party at the parliament building to celebrate Mr Trump's win. Former Soviet Mikhail Gorbachev has also welcomed his triumph.
Relations between the US and Russia have become more tense because of the conflicts in Ukraine and Syria and allegations of Russian cyber attacks in the US during the presidential campaign.
Chinese President Xi Jinping congratulated Donald Trump in a telegram, state TV reported.
Earlier the foreign ministry said that China was hoping to work with the new US government to boost bilateral relations.
"US China trade relations are mutually beneficial. Two mature big powers like the US and China will handle things well," foreign ministry spokesman Lu Kang said.
"We look forward to working together with the new US administration to push forward consistent, healthy and stable China-US relations which could be beneficial to the people of the two countries and to the world."
President Hassan Rouhani said the result would not have any impact on Iran's policies. He was quoted by state media as saying the election result reflected internal discontent and instability within the US which would take a long time to be solved.
Speaking in relation to the Iran nuclear deal, President Rouhani asserted that it was a clever move by the Iranian government to establish it as a UN Security Council resolution rather than a deal with a single government.
Earlier Foreign Minister Mohammad Javad Zarif was quoted by the official Irna news agency as saying that the new US president should stick by the deal.
"Iran and America have no political relations, but it is important that the future US president realises his duty to uphold the multilateral obligations of the Joint Comprehensive Plan of Action, and we expect the international community to require this of the United States of America," he said.
Prime Minister Haider al-Abadi congratulated Mr Trump, saying he's looking forward to America's continued support in his country's fight against Islamic State (IS).
Mr Abadi said he hopes the "world and the United States will continue to support Iraq in fighting terrorism".
Mr Trump's future policy in the Middle East remains unclear.
President Ashraf Ghani said that his country and the US are "strategic partners in the fight against terrorism and partners in development".
"[The] Afghan government is hopeful that close co-operation [with] the new president-elect will further deepen ties between the two countries," a statement released by the presidential palace said.
Chief Executive Abdullah Abdullah added that "combating extremism and efforts to bring peace and stability" are the top priorities of both countries, along with strengthening economic, military, social and cultural ties.
Prime Minister Justin Trudeau says that "Canada has no closer friend, partner and ally than the United States".
"We look forward to working very closely with President-elect Trump, his administration, and with the United States Congress in the years ahead, including on issues such as trade, investment, and international peace and security," he says.
Conspicuously, President Enrique Pena Nieto does not congratulate Mr Trump on his victory.
Instead, he congratulates the US "for its electoral process" and tells the president-elect that he hopes the two countries will work together to form a stronger relationship.
The foreign ministry congratulated Donald Trump on his win, adding that they hoped the new chapter would be marked by "respect for non-intervention in internal affairs".
President Nicolas Maduro has repeatedly accused Washington of trying to overthrow the South American country's government, a charge that has been rejected by State Department representatives.
The two countries continue to engage in trade despite not having embassies in their respective capitals since 2010.
In her message of congratulations, Prime Minister Theresa May focused on the "special relationship" between the two countries. She said that she hoped that Mr Trump's win would mean a continuation of shared values, including "freedom, democracy and enterprise".
"We are, and will remain, strong and close partners on trade, security and defence," she said.
"I look forward to working with President-elect Donald Trump, building on these ties to ensure the security and prosperity of our nations in the years ahead."
President Francois Hollande said Mr Trump's victory "opens a period of uncertainty".
Speaking in a televised address, he said that there was now a greater need for a united Europe, able to wield influence on the international stage and promote its values and interests whenever they are challenged.
"The US is an old and venerable democracy," Chancellor Angela Merkel said.
"I watched the election result with particular suspense. Someone elected to be president by the American people in free and fair elections has importance far beyond the USA.
"For us Germans, other than with the European Union, we have no deeper connection than with the United States of America."
President Milos Zeman said Mr Trump's election was a victory over "media manipulation" as he congratulated the new US president.
"I would like to cordially congratulate Donald Trump. I had, as one of few European politicians, declared public support for this candidate... because I agree with his opinions on migration as well as the fight against Islamic terrorism," Zeman told reporters in a rare press briefing at the Prague Castle.
"I appreciate Donald Trump's public demeanour, he speaks clearly, sometimes roughly, but understandably, and avoids what is sometimes called political correctness."
Prime Minister Narendra Modi in tweets said: "We look forward to working with you closely to take India-US bilateral ties to a new height," he said.
Prime Minister Shinzo Abe pledged a continuing close relationship between the US and Japan in his congratulatory message.
"I express my heartfelt congratulations on your election as the next president of the United States," his statement said. "Japan and the United States are unshakeable allies connected by common values such as freedom, democracy, basic human rights and rule of law."
President Recep Tayyip Erdogan said on Wednesday he hoped Mr Trump's victory would lead to positive steps for the Middle East and more freedom in the world.
He called Mr Trump to congratulate him and the pair spoke about cooperation on issues including fighting terrorism, the Turkish presidency said.
"I hope that this choice of the American people will lead to beneficial steps being taken for the world concerning basic rights and freedoms, democracy and developments in our region," Mr Erdogan said in a speech in Istanbul.
Prime Minister Binali Yildirim has wasted no time in urging the president-elect to extradite exiled US-based Turkish cleric Fethullah Gulen, who is blamed for orchestrating a coup attempt earlier this year, a charge he denies.
"If you extradite in a short time the head of a terror organisation who has damaged our historic friendship, I am sure that you can give Turkish-US relations a new start and open a new page," he said.
President Mahmoud Abbas congratulated Mr Trump in a statement, expressing hope that "peace will be achieved during his term".
Israeli Prime Minister Benjamin Netanyahu said he hoped to reach "new heights" in relations with Mr Trump, who he described as "a true friend of the state of Israel".
"I look forward to working with him to advance security, stability and peace in our region," he said.
Earlier hard line Jewish Home party leader and Education Minister Naftali Bennett said the notion of a Palestinian state was over after Donald Trump's win.
"Trump's victory is an opportunity for Israel to immediately retract the notion of a Palestinian state in the centre of the country, which would hurt our security and just cause," he said.
"This is the position of the president-elect... The era of a Palestinian state is over."
President Ellen Johnson Sirleaf tells the BBC that she is "extremely saddened" by Donald Trump's victory.
"Our concern is whether President-elect Trump will have an African agenda and build bridges," she said. "We can only hope that he will do so in due course."
The president said that she was worried about the future of trade deals between the US and Liberia in particular and Africa in general.
"We do not know what his policy towards Africa will be," she said.
"Obviously we are concerned but we will have to give him the benefit of the doubt."
Finland, Sweden, Denmark and Norway may have had concerns about the new president, but were hopeful their close relations with the US would continue.
"Let's give Donald Trump the benefit of the doubt," Denmark's Prime Minister Lars Loekke Rasmussen said, as he urged the US not to "close in" on itself.
Any surprise was met with a shrug by Finnish Prime Minister Juha Sipila, a self-made millionaire, who pointed out the polls "got it pretty badly wrong about Brexit as well".
He said that US relations for Finland, which shares a 1,300km (800 mile) border with Russia, are of "paramount" importance and that Trump's victory wouldn't mean a change in the non-aligned county's defence policy, its close ties to Nato or Finnish-Russian relations.
Meanwhile, Norway's Prime Minister Erna Solberg congratulated Donald Trump, and Swedish Prime Minister Stefan Lofven said many Swedes were concerned about the election result, but that they had been "prepared" for it.
Polish President Andrzej Duda congratulated Mr Trump in a letter, and said: "We are particularly pleased that during this year's Nato Summit in Warsaw the US decided to increase its military presence in Poland, thereby strengthening the Alliance's Eastern flank.
"We sincerely hope that your leadership will open new opportunities for our co-operation based on mutual commitment."
President Daniel Ortega - who won his third term as leader on Sunday - said he believed "it is possible to work with the United States" on the world's problems "giving priority to peace" as he congratulated Mr Trump.
The United Nations
UN Secretary General Ban Ki-moon said that "in the aftermath of a hard-fought and often divisive campaign, it is worth recalling and reaffirming that the unity in diversity of the United States is one of the country's greatest strengths".
"I encourage all Americans to stay true to that spirit. Today's global challenges demand concerted global action and joint solutions. As a founding member of the United Nations and permanent member of the Security Council, the United States is an essential actor across the international agenda," he said.
Mr Ban added that "people everywhere look to the United States to use its remarkable power to help lift humanity up and to work for the common good" which included the battle against climate change, advancing human rights and "promoting mutual understanding... to achieve lives of peace, prosperity and dignity for all".
Secretary of State Cardinal Pietro Parolin says the Vatican "respects the American people's choice" and hopes that Donald Trump will "serve the wellbeing and peace of the world".
"There is need for everyone to work to change the world situation, which is in great distress", he is quoted by La Repubblica newspaper as saying.
The European Union
Foreign policy chief Federica Mogherini said that trans-Atlantic ties with the US went beyond the election of Donald Trump.
"We'll continue to work together, rediscovering the strength of Europe," she said.
EU Parliament President Martin Schulz said the result must be honoured and that Mr Trump "managed to become the standard-bearer of the angst and fears of millions of Americans".
President Rodrigo Duterte, the Philippines' tough-talking leader, offered his "warm congratulations" to the US president-elect.
According to his communications secretary, Mr Duterte "looks forward to working with the incoming administration for enhanced Philippines-US relations anchored on mutual respect, mutual benefit and shared commitment to democratic ideals and the rule of law".
Several leaders of right-wing parties in Europe have also welcomed Mr Trump's victory.
Marine Le Pen, the leader of the far-right French National Front (FN), sent her best wishes to Mr Trump, tweeting: "Congratulations to the new president of the United States Donald Trump and the free American people!"
Dutch anti-Islam populist lawmaker Geert Wilders also tweeted his congratulations.
Nigel Farage, the leader of the UK Independence Party who played a key role in the referendum leading to Britain's exit from the EU, tweeted: "I hand over the mantle to @RealDonaldTrump! Many congratulations. You have fought a brave campaign."