The world faces a starkly different America led by a President Donald Trump.
While the billionaire businessman's election was welcomed in some countries, others saw it as a big shock, as governments will now have to deal with a man who has cozied up to Vladimir Putin, told NATO allies they would have to pay for their own protection and vowed to make the Mexican government pay for a multibillion-dollar border wall.
Trump's win was particularly startling in Mexico, where his remarks calling Mexican immigrants criminals and "rapists" were a deep insult to national pride. Financial analysts have predicted a Trump win would threaten billions of dollars in cross-border trade, and government officials say they have drawn up a contingency plan for such a scenario, though without releasing details.
"It's DEFCON 2," Mexican analyst Alejandro Hope said. "Probably something as close to a national emergency as Mexico has faced in many decades."
"It depends if he means what he says and if he can do what he claims he wants to do," Hope added. "A massive deportation campaign could really put some stress on Mexican border communities. A renegotiation of NAFTA could seriously hobble the Mexican economy. It could create a lot of uncertainty. ... Financial markets could suffer."
The Mexican peso, which has tracked the U.S. election closely, fell sharply to 20.45 to the dollar late Tuesday before recovering somewhat. The Bank of Mexico's interbank rate had stood at 18.42 at the end of the day's trading.
In Europe, NATO allies now wait to see if Trump follows through on suggestions that America will look at whether they have paid their proper share in considering whether to come to their defense.
Trump's rhetoric has challenged the strategic underpinning of the NATO alliance, rattling its leaders at a time when Russia has been increasingly aggressive.
German Defense Minister Ursula von der Leyen called the vote "a big shock" and "a vote against Washington, against the establishment."
Von der Leyen said on German public Television on Wednesday that while many questions remain open, "We Europeans obviously know that as partners in NATO, Donald Trump will naturally ask what 'are you achieving for the alliance,' but we will also ask 'what's your stand toward the alliance.'"
The French populist, anti-immigrant politician Marine Le Pen congratulated Trump even before the final results were known, tweeting her support to the "American people, free!"
Foreign Minister Jean-Marc Ayrault said France would work with the new president and that European politicians should heed the message from Trump votes. "There is a part of our electorate that feels ... abandoned," including people who feel "left behind by globalization," he said.
Trump's victory is being viewed with shock and revulsion in Ireland, a country close to the Clintons and fearful of Trump's campaign pledge to confront U.S. companies using Ireland as a tax shelter.
The newspaper of record, the Irish Times, branded the New York businessman a "misogynistic racist liar" who would fan instability overseas and intolerance at home.
Irish Times columnist Fintan O'Toole wrote Wednesday: "The republic of Washington, Jefferson, Lincoln and Roosevelt is now the United Hates of America."
"President Trump is the creation of the same demographic that gave Europe its far-right authoritarian movements with such disastrous consequences for the world," he wrote. "This does not mean that we are facing an American fascism. But it does mean that Trump will not be able to rule without stoking and manipulating fear."
British Prime Minister Theresa May issued a statement saying she looks forward to working with Trump and building on the two countries' longstanding "special relationship." Her predecessor, David Cameron, had been outspoken in his criticism of Trump during the primary campaign.
Nigel Farage, acting leader of the UK Independent Party, which played an important role convincing Britons to leave the European Union, told The Daily Telegraph that Trump's victory would bring a "massive result" for Britain. A spokesman said Farage — who campaigned briefly with Trump — was flying to Washington on Wednesday.
Russian President Vladimir Putin sent Trump a telegram Wednesday morning congratulating him on his victory.
Moscow has been unusually prominent in the race. Clinton's campaign and the Obama administration blamed Russian hackers for leaked emails from the Democratic National Committee and Clinton campaign staff. Trump, in turn, has made complimentary remarks about Putin; the ties some of his advisers and former campaign officials have to Russia have raised suspicions.
"We of course regard with satisfaction that the better candidate of the two presented to the American voters was victorious," said Vladimir Zhirinovsky, leader of Russia's nationalist Liberal Democratic party, according to the Interfax news agency.
In Asia, security issues and trade will top the agenda for the new administration, from North Korea and the South China Sea to the contentious and yet-unratified Trans-Pacific Partnership trade agreement.
Chinese state media and government-backed commentators had signaled Beijing's preference for a Trump win. Like Russia, China is seen as favoring Trump because he appears less willing to confront China's newly robust foreign policy, particularly in the South China Sea.
Clinton, by contrast, is disliked in Beijing for having steered the U.S. "pivot" to Asia aimed at strengthening U.S. engagement with the region, particularly in the military sphere.
Scholar Mei Xinyu wrote in the Communist Party newspaper Global Times that China would find it easier to cope with a Trump presidency.
"Trump has always insisted on abandoning ideological division and minimizing the risks that unnecessary conflicts with other countries may bring to the U.S.," Mei wrote.
In Indonesia, the world's most populous Muslim country, social media was abuzz with speculation about whether Trump would follow through on campaign rhetoric calling for a ban on Muslims entering the United States. Some said they fear they would be prevented from visiting relatives and friends who live in America or traveling there as tourists.
News of Trump's widening lead hit hard in Cuba, which has spent the last two years negotiating normalization with the United States after more than 50 years of Cold War hostility, setting off a tourism boom. Trump has promised to roll back Obama's opening with Cuba unless President Raul Castro agrees to more political freedoms.
"If he reverses it, it hurts us," taxi driver Oriel Iglesias Garcia said. "You know tourism will go down."
In pubs, bars and restaurants in much of the world, people watched TV and took in the surprise news of Trump's victory.
At a pub in Sydney, Pamela Clark-Pearman, a 63-year-old Clinton supporter, sat nursing a beer.
"I never thought the Americans could be so stupid. I just think it's Brexit all over again," Clark-Pearman said, referring to the June 23 British vote to leave the European Union.
Serving the last drinks of the night at a Mexico City tavern where a half-dozen TVs were tuned to election news, bartender Angel Mendoza wondered what will happen to his 15 or so family members living in the United States, about half of whom are there illegally.
"They're not coming here," he said. "Their lives are already made there, but (now) with a certain fear."