“I want to tell the world community that while we will always put America’s interests first, we will deal fairly with everyone, with everyone — all people and all other nations,” Mr. Trump said in his victory speech.

Leaders from Asia, Europe and Latin America offered congratulations to Mr. Trump or to the United States, but the distinctions in their messages were noteworthy.

Some Advice From South of the Border

Latin American heads of state wished Mr. Trump well, and offered their own ideas on how he might govern.

Venezuela, a country that Mr. Trump has repeatedly criticized for its leftist leadership, asked Mr. Trump to essentially mind his own country’s business by “respecting nonintervention in internal issues and to the right of development and peace.”

Juan Manuel Santos, the president of Colombia and Nobel Peace Prize laureate, said he hoped Colombia and the United States “will continue deepening bilateral relations.” Mr. Trump has criticized a trade agreement between Colombia and the United States, among many other trade deals.

“The excesses of this eccentric millionaire have proven that the number one enemy of the U.S. is not beyond its borders, but rather within,” wrote Vladimir Flórez, a Colombian cartoonist popularly known as Vladdo, in El Tiempo newspaper. “This threat called Trump is a product of American society; a nightmarish mutation of the American dream.”

Across the Border, Appeals for Calm

Image

News on the United States election in Mexico City. President Enrique Peña Nieto of Mexico congratulated the American people on their election and stressed his nation’s willingness to work with them.CreditCarlos Jasso/Reuters

Mr. Trump’s campaign — and his promise to build a wall on the United States-Mexico border and to deport millions of immigrants in the country illegally — became a rallying point for Mexicans.

He has promised to blow up the North American Free Trade Agreement, or Nafta, upending commerce between the two countries, valued at about $500 billion a year.

Early on Wednesday — as the peso gyrated — President Enrique Peña Nieto said, “Mexico and the U.S.A. are friends, partners and allies.”

Andrés Manuel López Obrador, a popular leftist politician and likely 2018 presidential candidate, asked Mexicans “to remain calm,” and said, “We will stay together no matter what the circumstances are.”

Foreign Minister Claudia Ruiz Massieu repeated in a television interview on Wednesday morning that Mexico would not pay for the wall.

— AZAM AHMED

In Argentina, Clinton Supporters Shift Gears

President Mauricio Macri had rooted for Hillary Clinton but said he hoped to work with Mr. Trump. “One of the issues that worried us is the transition,” he said. “We will have to adapt, and that is what we will do.”

Earlier in the week, Foreign Minister Susana Malcorra warned that a Trump victory would bring relations between the United States and Argentina “to a standstill,” but on Wednesday she praised his “conciliatory” victory speech.

— DANIEL POLITI

Trudeau Affirms Canada’s Friendship

Prime Minister Justin Trudeau, who enjoys a close relationship with President Obama, said that “Canada has no closer friend, partner and ally than the United States.”

He added, “The relationship between our two countries serves as a model for the world.”

But Mr. Trump’s promise to revisit Nafta brings unwelcome uncertainty to Canada’s economy. Mr. Trudeau’s open approach to immigration and refugees is the inverse of Mr. Trump’s. And Canada will be in a difficult position if it imposes carbon taxes only to find that Mr. Trump undoes all American efforts to mitigate climate change.

One of the few positive developments for Canada is Mr. Trump’s promise to reverse the Obama administration’s decision to block the Keystone XL pipeline.

From the U.N. and NATO, Reminders of America’s Role

Ban Ki-moon, the United Nations secretary general, said it was “worth recalling and reaffirming that the unity in diversity of the United States is one of the country’s greatest strengths.”

As if to remind the United States of its role as a guarantor of world stability, he noted that it is “an essential actor across the international agenda.”

Mr. Trump has demanded that the NATO allies of the United States foot more of the bill for their collective defense. Jens Stoltenberg, the NATO secretary general, noted that the alliance comes with legal obligations.

“NATO’s security guarantee is a treaty commitment and all allies have made a solemn commitment — a solemn commitment — to defend each other,” Mr. Stoltenberg said. “We have to remember that the only time that we have invoked Article 5, our collective defense clause, is after an attack on the United States, after 9/11.”

— RICK GLADSTONE and JAMES KANTER

Anxiety in Europe

Image

Chancellor Angela Merkel of Germany congratulated Mr. Trump on Wednesday and offered her cooperation, but she emphasized that it must rest on human rights and nondiscrimination.CreditAxel Schmidt/Reuters

The two top officials of the European Union — Donald Tusk, president of the European Council, and Jean-Claude Juncker, president of the European Commission — congratulated Mr. Trump and invited him to visit Europe. “Europeans trust that America, whose democratic ideals have always been a beacon of hope around the globe, will continue to invest in its partnerships with friends and allies, to help make our citizens and the people of the world more secure and more prosperous,” they wrote.

Later, however, Mr. Tusk, a former prime minister of Poland, warned that Britain’s decision to leave the European Union, and the election of Mr. Trump, should raise alarms. “The events of the last months and days should be treated as a warning sign for all who believe in liberal democracy,” he said.

Guy Verhofstadt, the leader of a prominent groupof lawmakers in the European Parliament and a former prime minister of Belgium, called Mr. Trump’s victory “a wake-up call for European leaders,” adding, “Donald Trump has declared several times that our priorities are not his.”

He added: “We cannot be dependent anymore on the U.S., we have to take charge of our own destiny. Europe should get its act together, too, and set its internal differences aside.”

Britain’s prime minister, Theresa May, spoke of the country’s “enduring and special relationship” with the United States.

President François Hollande of France noted that “some of Donald Trump’s campaign positions must be put to the test of the values and the interests that we share with the United States.” He added that “disorders in the world are worrying people everywhere, including the people of America, the first world power.” The French prime minister, Jean-Marc Ayrault, asked, “What will become of the Paris agreement on the climate, of the nuclear deal with Iran that Donald Trump wants to reconsider?”

Chancellor Angela Merkel congratulated Mr. Trump and offered her cooperation — but stressed that it must rest on human rights and nondiscrimination. Germany’s foreign minister, Frank-Walter Steinmeier, said that “if Donald Trump really wants to be president of all Americans, then I think his first duty is to fill in the deep rifts which arose during the campaign.”

— AURELIEN BREEDEN, JAMES KANTER and ALISON SMALE

Rejoicing From Far-Right Leaders

“The Americans are taking their country back,” Mr. Wilders, a lawmaker who leads the Party for Freedom and who faces hate-speech charges in his home country, wrote on Twitter. He called Mr. Trump’s election “a historic victory” and “a revolution.”

Ms. Le Pen, the leader of the National Front in France and a candidate for the French presidency, congratulated Mr. Trump on Twitter and declared the American people “free!” She called it “good news for our country.”

Prime Minister Viktor Orban of Hungary, one of the few European leaders who spoke favorably of Mr. Trump during the campaign, wrote on Facebook: “What a great news. Democracy is still alive.”

— BENOÎT MORENNE and MARTIN de BOURMONT

Iran Vows to Maintain Nuclear Agreement

Image

The flags of the United States and Iran during nuclear talks in Vienna in July. The head of Iran’s atomic energy program said the country would “try to continue to implement’' the nuclear agreement.CreditCarlos Barria/Reuters

Mr. Trump has called the January agreement between Iran and world powers “the worst deal ever,” and he has vowed to unilaterally abandon it. Under the agreement, Iran has given up large chunks of its nuclear program in exchange for some sanctions relief.

The head of Iran’s atomic energy program told the semiofficial Tasnim news agency on Wednesday that the country would “try to continue to implement the nuclear agreement.”

Iran’s supreme leader, Ayatollah Ali Khamenei, said last week that the presidential debates had illustrated “the crisis America is in.” Some analysts said the election of Mr. Trump was the result of an “awakening,” Iran’s ideological label for some of the Arab Spring revolts.

One analyst, Farshad Ghorbanpour, who is close to the government of the Iranian president, Hassan Rouhani, said he feared the implications for Mr. Rouhani, who has been promoting better relations with Washington. “Our hard-liners will pressure him, they are very happy now,” he said.— THOMAS ERDBRINK

Netanyahu Calls Trump ‘a True Friend’ of Israel

Image

Keeping tabs on the American presidential election results from a bar in central Tel Aviv.CreditAbir Sultan/European Pressphoto Agency

“President-elect Trump is a true friend of the State of Israel, and I look forward to working with him to advance security, stability and peace in our region,” Prime Minister Benjamin Netanyahu said in a statement. The United States is Israel’s most important ally.

The Israeli government, which has often had a tense relationship with the Obama administration, has studiously avoided taking sides, but at the same time, Jerusalem has moved to improve relations with India and Russia, and is in talks to develop economic ties with China.

— ISABEL KERSHNER

Uncertainty for a Middle East Already in Tumult

Across the Middle East, where the United States has a long history of often divisive involvement, many seemed to have no idea how to react to the election of Mr. Trump.

President Abdel Fattah el-Sisi of Egypt and Prime Minister Binali Yildirim of Turkey quickly congratulated Mr. Trump, but official reaction was scarce from Saudi Arabia. Mr. Trump said the kingdom may no longer be able to count on American defense guarantees and should give the United States “free oil for the next 10 years.”

Syrians, too, said they had little inkling what the vote would mean for the civil war in their country, although many in the opposition had expressed hope that a victory for Hillary Clinton would mean more robust support for the rebels fighting to topple President Bashar al-Assad.

“I am scared, scared for Syria,” said Murhaf Jouejati, the chairman of the Day After organization, an independent body that aims to prepare Syrians for a democratic future. “Here is a man who is openly saying that he is going to defer to the Russians on Syria. This is a clear victory for the Assad regime.”

Many have expressed worry that Mr. Trump’s negative statements about Islam and Muslims would translate into aggressive policies in the region, as well as making it harder for displaced Syrians to seek refuge.

— BEN HUBBARD, ANNE BARNARD and HWAIDA SAAD

In Japan, Anxiety From an Ally

Image

Monitors displaying election news at a foreign exchange trading company in Tokyo on Wednesday.CreditYuya Shino/Getty Images

Prime Minister Shinzo Abe, who had been planning to meet Mrs. Clinton in Washington in February, tried to calm his country, as the yen surged and stocks stumbled. “Hand in hand with Trump, we will try to work together,” he said.

On the campaign trail, Mr. Trump singled out Japan. He claimed that Tokyo was not paying its fair share to support United States military bases, calling into question the American commitment to defend Japan in case of attack.

A rising China could put a check on Mr. Trump’s stated ambitions in Asia. “Maybe he will decrease the commitment to Pacific security issues,” said Shin Kawashima, professor of international relations at the University of Tokyo. “But if he carries out such a policy, China will be much more authoritative and aggressive in the Pacific. And then most of the alliance countries and security experts in Washington will be against Trump’s policies. It is a little difficult for Trump to just change all the old policies.”

South Korea Warns the North Not to ‘Misjudge’

Image

A cardboard cutout of Donald J. Trump in the background as people watch the presidential election at an event at the United States Embassy in Beijing on Wednesday.CreditJason Lee/Reuters

President Park Geun-hye of South Korea instructed her government to coordinate closely with Mr. Trump’s transition team to ensure that her country and the United States would maintain sanctions and pressure on North Korea to stop its nuclear weapons program.

“North Korea should not misjudge the solidity of our alliance with the United States and our joint ability to respond” to provocations, said Jeong Joon-hee, a government spokesman.

Mr. Trump unsettled South Koreans when he said that he might withdraw American troops from their country unless Seoul paid more for their presence. He also indicated that he might let Japan and South Korea protect themselves with nuclear weapons and that he might negotiate directly with the North Korean leader, Kim Jong-un.

Mr. Trump’s surprisingly strong performance caught analysts off guard, but it was welcome news for those in South Korea who believe that their country must build its own nuclear weapons to defend against North Korea.

In Southeast Asia, Two Leaders Back Trump

Prime Minister Najib Razak of Malaysia was one of the first leaders to offer effusive praise for Mr. Trump.

“The world has watched this year’s presidential election with fascination,” he said in a statement. “At almost every turn, media commentators have been proved wrong and the results anticipated by experts have been overturned. Donald Trump was considered a distant outsider when his candidacy was first announced. He beat the establishment consensus by winning the Republican nomination, and did so again with his remarkable victory today. Mr. Trump’s success shows that politicians should never take voters for granted.”

Mr. Najib, who has stared down corruption charges, added, “His appeal to Americans who have been left behind — those who want to see their government more focused on their interests and welfare, and less embroiled in foreign interventions that proved to be against U.S. interests — have won Mr. Trump the White House.”

A Surprise for the World’s Largest Democracy

Prime Minister Narendra Modi said in a tweet addressed at Mr. Trump, “We appreciate the friendship you have articulated towards India during your campaign.”

For India, a central question is whether Washington will reduce its military presence.

“If that is called into question, India will no longer be able to rely on the U.S. to be there as a security provider,” said Dhruva Jaishankar, a fellow at the Brookings Institution India Center. The result could be more assertive attitudes from China, Japan and Korea.

As far as any change in the relationship between India and the United States is concerned, she predicted, “You will find the Trump administration being realistic about Pakistan, being realistic about India and realistic about China.”

Australia Says U.S. Has ‘No Better Friend’

Prime Minister Malcolm Turnbull reassured his people that “Americans understand that they have no stronger ally, no better friend, than Australia.”

Mr. Turnbull said the American role in the Pacific region had underpinned stability, economic growth and a rules-based order, a term he and Foreign Minister Julie Bishop have used when discussing the resolution of disputes with China over territorial and fishing rights in the South China Sea.

“I have great confidence that all of our engagement will continue to be strong and intimate, filled with the trust and confidence that has characterized it for so many years,” Mr. Turnbull said.