'I very much look forward to working with you for our shared values,' South Korean President Moon Jae-in said, echoing the common theme.
World leaders congratulated U.S. President-elect Joe Biden on his victory, cheering it as an opportunity to fortify global democracy and celebrating the significance of Americans having their first female vice president.
Although Donald Trump did not concede defeat, relief was a common theme expressed in many parts of the world to the news that his reelection bid had failed.
"The Americans have chosen their President. Congratulations @JoeBiden and @KamalaHarris! We have a lot to do to overcome today's challenges. Let's work together!" said French President Emmanuel Macron on Twitter.
Other leaders who sent congratulations included German Chancellor Angela Merkel, NATO Secretary General Jens Stoltenberg, and Egyptian President Abdel-Fattah el-Sissi.
The president of Ukraine, Volodymyr Zelensky, whose country was central to Trump's impeachment and an attempt by the Trump campaign to paint Biden and his family as corrupt, offered congratulations.
Most Western allies quickly welcomed a fresh start with a new administration in Washington.
"We're looking forward to working with the next U.S. government," German Foreign Minister Heiko Maas said on Twitter. "We want to work in our cooperation for a new trans-Atlantic beginning, a New Deal."
Word of the victory in Pennsylvania that pushed Barack Obama's former vice president past the threshold of 270 Electoral College votes needed to take over the Oval Office cascaded around the globe on social media and live news broadcasts, sparking celebrations.
The was no immediate official reaction from China, which has a series of conflicts with the Trump administration over trade, security and technology. But social media users welcomed the change. A posting on the popular Sina Weibo microblog service, signed Gong Teng Xin Yi, said, "Congratulating Biden, the old friend of Chinese people on winning the election."
President Tsai Ing-wen of rival Taiwan, the democratic island claimed by the communist Beijing government as part of its territory, congratulated Biden and Harris. Taiwan has no official relations with Washington but the Trump administration strengthened informal ties by sending Cabinet officials to visit, which irritated Beijing.
"The values on which we have built our relationship could not be stronger," Tsai said on Twitter. "I look fwd to working together to further our friendship, & contributions to int'l society."
The outcome inspired disbelief in Slovenia, the homeland of first lady Melania Trump. Prime Minister Janez Jansa was the only world leader who congratulated Trump even before all the votes were counted, and showed support after Biden's win was announced.
It also drew mixed reviews in Iraq. Many Iraqis remember Biden as having been a champion of the U.S. invasion of Iraq in 2003. Activists who have been protesting neighboring Iran's heavy hand in Iraq, had supported Trump and cheered the U.S. assassination of Iran's top general in an airstrike at Baghdad's airport at the beginning of the year.
Still, Iraqi President Barham Salih tweeted his congratulations to Biden, describing him as a friend and trusted partner.
Indeed, detractors were outliers. Congratulations poured in from nations that disagreed with Trump administration policies, as well as from leaders who had gotten along with the Republican president but now were essentially ignoring his claims that the divisive election wasn't over.
In South Korea, a U.S. military ally that was pressured by Trump into renegotiating trade arrangements with the United States, President Moon Jae-in congratulated Biden and Harris. "Our alliance is strong and the bond between our two countries is rock-solid," Moon said on Twitter. "I very much look forward to working with you for our shared values."
Venezuela's embattled president, Nicolas Maduro, and his U.S.-backed rival each congratulated Biden. Maduro said on Twitter, Venezuela "will always be ready for dialogue and understanding" with Washington. His rival, Juan Guaido, also thanked Trump and Vice President Mike Pence for their "firmness and determination" in confronting Maduro.
Crown Prince Mohammed bin Zayed Al Nahyan of the United Arab Emirates, who is close to Trump's son-in-law Jared Kushner, extended his best wishes to Biden and Vice President-elect Kamala Harris on Twitter.
Indian Prime Minister Narendra Modi, who has been known for public displays of bonhomie with Trump, shared a photo of himself with Biden and offered his congratulations "on your spectacular victory!"
British Prime Minister Boris Johnson, another Trump ally, hailed Biden's win and said he looked forward to "working closely together on our shared priorities, from climate change to trade and security."
Both Modi and Johnson commented on Harris' election as the first Black female vice president. Modi said her win is a "matter of immense pride" for all Indian-Americans.
Harris' late mother was from India. Kamala is Sanskrit for "lotus flower," and Harris gave nods to her Indian heritage throughout the campaign. Her election struck an immediate chord internationally and inspired calls in parts of Africa for governments long run by men to think again.
"Kamala Harris lights up the tunnel for many women who continue to advocate for gender equality and inclusion in leadership!" tweeted Anne Waiguru, one of two female governors in Kenya, where the Supreme Court president has advised the country's president to dissolve parliament for failing to have enough female lawmakers.
"The time has also come to give our women the chance to occupy such a high office in our country and even the number one position," tweeted a Nigerian Cabinet minister, Festus Keyamo.
Nigeria's President Muhammadu Buhari said Biden's track record "gives us hope that he will add value to the presidency," and urged the President-elect to tackle the "negative consequences of nationalist politics on world affairs — which have created divisions and uncertainties."
While outspoken disappointment was scarce, several leaders who have maintained warm relations with Trump's administration kept silent. That included Brazil's President Jair Bolsonaro, Israeli Prime Minister Benjamin Netanyahu and Crown Prince Mohammed bin Salman of Saudi Arabia.
Mexican President Andrés Manuel López Obrador, who struck up a cordial working relationship with Trump, also avoided congratulating Joe Biden.
"We are going to wait until all the legal issues are resolved. We do not want to be reckless," López Obrador said in answer to a reporter's question at a news conference. He said Trump has been "very respectful of us."
There was also no immediate statement from Russia's President Vladimir Putin.
Many people, particularly in nations with turbulent politics, took Biden's win as improving the outlook for respect of democracy. Among them was Tanzanian opposition leader Zitto Kabwe, who was arrested and charged with terrorism-related offenses after his country's bruising presidential election.
"This victory symbolizes the hope for democracy at a time when many other parts of the world are seeing that light diminishing. It gives hope that integrity, honesty and perseverance still matter," Kabwe said.
In Egypt, where the government is cracking down on dissent, pro-democracy activists welcomed Biden's win.
"It's over. The world is without Trump. The sweetest news in 2020," Anwar el-Hawary, the former editor of Egypt's Al-Masry Al-Youm newspaper, the country's largest independent daily, said in a Facebook post.
Argentine President Alberto Fernández tweeted congratulations to Biden and Harris and described their election victory as a "clear expression of the popular will."
Biden's win also encouraged people living under populist governments in central Europe that have eroded democratic norms. Trump has been friendly with the right-wing government in Poland. It is widely believed there that his support allowed Polish leaders to undermine judicial independence.
"Trump's defeat can be the beginning of the end of the triumph of far-right populisms also in Europe," said Donald Tusk, a former European Union leader and former Polish prime minister. "Thank you, Joe."