Around the globe, right-wing leaders reacted to the victory of Republican Donald Trump with joy, while some expats and politicians expressed dismay and anxiety for international relations. (Jenny Starrs/The Washington Post)

Around the globe, right-wing leaders reacted to the victory of Republican Donald Trump with joy, while some expats and politicians expressed dismay and anxiety for international relations. (Jenny Starrs/The Washington Post)

Allies recoiled. Adversaries rejoiced. And on the day after U.S. voters made Donald Trump the country’s 45th president, the world was left to collectively wonder: What happened to America?

The question hung in the air even as once-unthinkable congratulatory messages poured into Trump Tower from capitals across the globe.

Foreign leaders who had spent months disparaging the Republican nominee as unfit for office were forced to reckon with the reality that he will soon govern the world’s sole superpower. U.S. foes who may have only dreamed of a Trump presidency seemed to scarcely believe their good fortune.

[Live updates from the 2016 election and reactions]

Through it all on Wednesday was a palpable sense that Trump’s stunning victory could fundamentally transform the global order — though in this endlessly unpredictable year, no one dared forecast exactly how.

In China, Russia and Israel, we ask people what they think of the election of Donald Trump as the 45th president of the United States. We’ll update this video as more voices come in. (Jason Aldag/The Washington Post)

“We have no idea what this American president is going to do, when this voice of anger will be the most powerful man in the world,” Norbert Röttgen, chairman of the German Parliament’s foreign affairs committee, told public broadcaster Deutschlandfunk. “Whether he knows his allies and friends, how he is going to approach Vladimir Putin, an authoritarian ruler, how he is going to act when it comes to the question of nuclear armament, all these questions are completely open.”

That profound uncertainty was masked by a succession of bland statements from Trump’s soon-to-be counterparts among the ranks of global leaders.

[Intelligence community is already feeling a sense of dread about Trump ]

Through gritted teeth, democratically elected allies congratulated Trump on his victory and promised business as usual.

In Britain — where the Parliament in January debated banning Trump from even visiting the country — Prime Minister Theresa May said her nation and the United States had “an enduring and special relationship based on the values of freedom, democracy and enterprise.” That, she insisted, would carry forward under Trump.

Global autocrats were far more enthusiastic.

News of the Republican’s victory was greeted with broad smiles and a round of applause in the lower house of the Russian parliament. In a Moscow ceremony to welcome new ambassadors, Putin referenced Trump’s call for warmer ties and said “Russia is ready and willing to restore full-fledged relations with the United States.”

1 of 26 Full Screen Autoplay Close Skip Ad × The world reacts to results of U.S. election View Photos People around the globe watched as Donald Trump was elected the 45th president of the United States. Caption People around the globe watched as Donald Trump was elected the 45th president of the United States. Nov. 12, 2016 Activists take part in an anti-Donald Trump demonstration at the Angel de la Independencia monument in Mexico City. Edgard Garrido/Reuters Buy Photo Wait 1 second to continue.

Egyptian President Abdel Fatah al-Sissi, whose record of imprisoning opponents and restricting speech has earned him condemnation from human rights groups, said he “looks forward to the presidency of President Donald Trump to inject a new spirit into the trajectory of Egyptian-American relations.”

In a later statement, Sissi’s office boasted that the Egyptian president was the first world leader to reach Trump by phone and personally congratulate him.

Burundi’s controversial leader, Pierre Nkurunziza, who has been accused of directing the killing of civilians, said of Trump, “Your victory is the victory of all Americans.”

[Donald Trump wins the presidency in stunning upset over Clinton]

Democracy activists and human rights campaigners, meanwhile, were despairing.

In Brazil, analysts noted that the United States now has the kind of leader more commonly associated with Latin America — a “caudilho,” an authoritarian and charismatic figure often linked to military or landowning elites who responds to a desire for “dramatic solutions.”

“The North American electorate broke open the shell of the serpent’s egg that Donald Trump incubated during the campaign this Tuesday,” wrote Clóvis Rossi, a columnist for Brazil’s Folha de S.Paulo newspaper. “Therefore all of the demons that the politically correct had buried or at least eased in United States society are loose.”

In the Middle East, Trump’s win was seen as a decisive victory for Syrian President Bashar al-Assad, Egypt’s Sissi, Turkish President Recep Tayyip Erdogan and other leaders who routinely flout the rights of their political opponents.

“[Trump] is not going to talk about human rights, definitely,” said Hisyar Ozsoy, a parliament member representing Turkey’s opposition pro-Kurdish Peoples’ Democratic Party, or HDP, whose leaders have recently been arrested. “He will remain deaf and blind to whatever happens here if he wants to work with Turkey.”

Erdogan, who had criticized Trump during the presidential campaign for showing intolerance toward Muslims, said the Republican’s victory was a “positive sign” and the “beginning of a new era in the United States.”

[Markets staggered by Trump’s shock victory but stage partial recovery]

There was no such optimism among the United States’ closest democratic allies.

In Europe, there was never any secret about the continent’s overwhelming preference for Democratic nominee Hillary Clinton.

For months, leaders have spoken openly of their contempt for Trump and their fear of the consequences should he be elected — views that, according to pre-election polls, were reflected in a European public that saw a Trump win as a reason to be “afraid.” On Wednesday, the terms “shock” and “nightmare” were trending on Twitter in Germany.

Trump’s win had many European nations scrambling to understand his intentions on foreign policy, which have been only loosely sketched out.

Envoys from major U.S. allies typically meet campaign advisers to Democrats and Republicans ahead of elections to try to understand how elections will affect them. That was easy to do with the Clinton campaign, which was studded with veterans from her decades in the public eye. But countries such as Germany — Europe’s dominant power — have not been able to secure meetings with the Trump campaign, officials said.

In Brussels, diplomats fretted about the consequences for NATO, which was the target of sharp rhetoric from Trump during the campaign as he questioned the priorities of the military alliance. While the Obama administration has committed a battalion of troops to Eastern Europe to deter a resurgent Russia, Trump has proposed a radically different approach to the Kremlin.

But mainstream leaders who just a day before were openly criticizing Trump moved quickly Wednesday to play nice, recognizing that they had no choice but to work with the new American president.

“It wasn’t what we were expecting,” said David McAllister, a German lawmaker who is the head of the European Parliament’s delegation to the United States. “We Europeans need the Americans to guarantee our security, and we have a huge interest in transatlantic relations.”

The quiet grimaces from Europe’s mainstream contrasted vividly with the cheers from the continent’s far right.

Trump’s win was immediately seen as a possible harbinger of a far-right victory in France's 2017 presidential election, which analysts now say could represent a third chapter in a string of stunning populist upheavals.

“It’s a divine surprise for the National Front,” said Dominique Moisi, a co-founder of the French Institute for International Relations. “Suddenly the possibility that after Brexit and after Trump there could be Marine Le Pen is striking the French.”

To many in Britain, Trump’s victory was stunning — but also familiar, coming as it did less than five months after the country voted to leave the European Union.

“Trump said himself that his election would be ‘Brexit plus plus.’ and he was right,” said Thomas Roulet, a management professor at King’s College London.

[27 years after Berlin Wall, Europe wakes up to a U.S. president-elect promising a wall of his own]

Nowhere was the result felt more keenly than in Mexico, where the peso crumbled. “It feels like our nightmare is here,” tweeted Jorge Guajardo, who was Mexico’s ambassador to China from 2007 to 2013.

Trump’s disdain for Mexican immigrants and his pledges to build a wall along the Mexican border and renegotiate the North American Free Trade Agreement have made him a figure of hate for many Mexicans.

“Mexico will have a very big problem having good relations with him,” said Raul Benitez Manaut, a professor at Mexico’s National Autonomous University. “Mexicans are very nationalistic, and they feel aggrieved by Trump.”

In South Africa, as well, many were angered by the election of a man who had called their nation “a crime-ridden mess that is just waiting to explode.”

A Trump victory “is a victory for right-wing‚ racist politics. It doesn’t bode well for the world,” Cape Town Mayor Patricia de Lille told the country’s Business Day newspaper.

Trump’s victory was also deeply concerning to the governments in Japan and South Korea, Washington’s two closest allies in Asia. On the campaign trail, Trump had repeatedly pledged to upend the American military pacts with both countries, saying neither was paying enough for its defense against a nuclear-armed North Korea and a strengthening China.

“The current situation seems like the beginning of the U.S.’s decline and a beginning of the failure of democracy,” said Hasung Jang, a professor of finance at Korea University in Seoul.

China’s state media made a similar point.

“The probably most divisive and scandalous election in American history has eroded voters’ faith in the two-party system, as many voters called it a game of money, power, and influence,” wrote the state-run Xinhua News Agency.

Meanwhile, governments that have been out of favor under President Obama foresaw new opportunities under Trump. Israeli politicians called for Trump to make good on his campaign promise to move the U.S. Embassy to Jerusalem, a long-running source of contention. And they predicted an even bigger triumph in the region’s decades of conflict.

“The era of the Palestinian state is over,” said Education Minister Naftali Bennett.

Others in countries on the outs with Obama were far less sanguine.

In the Philippines, the mood was somber at the U.S. Embassy’s election party, with a crowd of Filipino Americans and students eager to study in the United States expressing fear, shock and disappointment.

“The U.S. is known as a country for immigrants, as the land of the free, but he wants to build a wall,” said Carlos Llamas, a 19-year-old college junior studying consular and diplomatic affairs. “As president you are chief diplomat for your country, but he doesn’t act like that.”

Denyer reported from Beijing. Joshua Partlow in Mexico City; Michael Birnbaum in Brussels; Loveday Morris and William Booth in Irbil, Iraq; Erin Cunningham in Istanbul; Emily Rauhala in Manila; Rama Lakshmi in New Delhi; Yuki Oda in Tokyo; Yoonjung Seo in Seoul; Congcong Zhang, Luna Lin and Jin Xin in Beijing; Stephanie Kirchner in Berlin; Sudarsan Raghavan in Sanaa, Yemen; Pamela Constable in Kabul; Louisa Loveluck and Liz Sly in Beirut; Kevin Sieff in Nairobi; Dom Phillips in Rio de Janeiro; and James McAuley in Paris contributed to this report.

Read more:

Canada’s immigration website has just crashed — Trump fears?

Obama’s ‘failed regime’ will enter the ‘cesspool of history’ says North Korea

Today’s coverage from Post correspondents around the world