Moon Jae-in, the presidential candidate of the Democratic Party of Korea, and his wife, Kim Jung-sook, vote at a polling site in Seoul. (Yonhap/European Pressphoto Agency)

South Koreans have elected a new president who is wary of the United States and wants to foster warmer ties with North Korea, opening a new and potentially difficult chapter in relations with Washington.

Moon Jae-in of the liberal Democratic Party claimed victory Tuesday night after securing an unassailable lead. With 65 percent of the votes counted, he had 39.6 percent.

His closest rivals, conservative Hong Joon-pyo and centrist Ahn Cheol-soo, had 26 percent and 21 percent, respectively. Both conceded while the votes were still being counted.

“From tomorrow onward, I will serve as your president,” Moon told cheering crowds of supporters in Gwanghwamun Plaza, the central Seoul square where hundreds of thousands of South Koreans held candlelight protests against President Park Geun-hye, leading up to her impeachment and triggering Tuesday’s election.

“I will become the president for everyone, even those who didn’t support me,” said Moon, who lost to Park in the 2012 presidential election.

(The Washington Post)

Moon’s victory will end almost a decade of conservative rule in South Korea and the hard-line approach toward North Korea that had Seoul walking in lockstep with Washington.

While the Trump administration is calling for “maximum pressure” on North Korea, South Korea will have a president who has pledged to resume engagement with the North — including reopening an industrial park that the previous administration said was funneling cash to the regime in Pyongyang.

But analysts said Moon, 64, a former human rights lawyer, is likely to be constrained and more pragmatic in office, playing down the prospects of a serious rift with the United States even if the tone of the relationship changes.

“We still have the alliance, and North Korea still has nuclear weapons. None of these things have changed,” said James Kim, an international relations expert at the Asan Institute for Policy Studies in Seoul, referring to the six-

decade-long security alliance between South Korea and the United States.

“There is a reason we have this alliance, and these things are very difficult to change. It can’t be done by one individual just because he wants to,” Kim said.

[ South Korea’s Moon reassures voters yearning for calm ]

Tuesday’s snap election was called after months of protest that led to the impeachment of Park over a corruption scandal.

Park is behind bars and standing trial on 18 charges, including bribery and coercion, after it emerged that a confidante was using their relationship to extract money from South Korean conglomerates, including Samsung.

South Koreans were eager to end the turmoil. Since President Trump’s election, they have watched the leaders of China and Japan go to Trump’s resort in Florida for talks while their acting leader barely received a phone call from Washington.

In a statement Tuesday, the White House said: “We look forward to working with President-elect Moon to continue to strengthen the alliance between the United States and the Republic of Korea and to deepen the enduring friendship and partnership between our two countries.”

Moon said his victory underscored the South Korean people’s “desperate wish” for a change in government.

“We did our utmost to help realize this aspiration of the people, and I believe that was the driving force that enabled our victory today,” he told supporters in Seoul.

But many South Koreans were voting against conservatives rather than for Moon, said Kang Won-taek, a professor of political science at Seoul National University.

“What people who were protesting wanted was political change, and a natural consequence of that is a change in government,” Kang said.

[ South Korea’s likely next president asks the U.S. to respect its democracy ]

But after the upheaval of the past six months, expectations for the next president are high.

To an electorate sick of the corruption that the Park scandal ­exposed, Moon has promised to improve transparency in government appointments and strengthen regulations on the conglomerates that dominate corporate South Korea.

Voters were also concerned about the anemic economy and the widening disparity between rich and poor. Moon promised to put together a huge stimulus package, to create 810,000 public-

sector positions and to reduce long working hours.

These will be difficult to achieve, especially because Moon’s party does not hold a majority in the National Assembly. Democrats have 119 seats in the 299-seat parliament, and general elections are not due until 2020.

“The Park Geun-hye era witnessed further concentration of wealth and power and instances of government officials using public office for private gain,” said Kim Yun-cheol, a professor of political science at Kyung Hee University. “The task facing the incoming president will be to solve these problems.”

Although domestic issues dominated the campaign, foreign affairs were much higher up the agenda than usual, in large part because of Trump’s election in the United States and the stance he has taken on North and South Korea.

Trump has called for “maximum pressure” on North Korea to make Kim Jong Un’s regime give up its nuclear and missile programs, and he has threatened to use military force, an approach that could push North Korea to unleash artillery fire on Seoul.

[Interview with Moon Jae-in, set to become South Korea’s next president ]

Meanwhile, Moon has said that he is open to going to Pyongyang to meet Kim if it would help resolve the nuclear problem and that he wants to return to the “sunshine policy” of previous liberal presidents. This began in 1997 — well before North Korea had proved any nuclear capability — and involved economic engagement with the North to reduce the gaps between the two Koreas.

Moon served as chief of staff to Roh Moon-hyun, a liberal president who governed between 2003 and 2008 and who inherited the sunshine policy of liberal predecessor Kim Dae-jung. During this period, South Korea began tours to the North Korean mountain resort of Kumgangsan and opened the industrial park at Kaesong, where North Koreans worked in factories owned by South Korean companies.

In an interview with The Washington Post before his election, Moon played down his differences with Trump, saying he believed the American was “more reasonable than he is generally perceived.”

But Trump has had some tough words for South Korea, too. The U.S. president has said he will make South Korea pay $1 billion to host a controversial American missile defense system — contrary to the countries’ agreement that South Korea provide the land and the United States the battery.

Moon has vowed to review the Park government’s decision to host the Terminal High Altitude Area Defense system, or THAAD, as the battery is known, and Trump’s words have only bolstered his case.

Trump is also threatening to tear up a free-trade deal that forms the basis of the countries’ economic alliance. Moon has said he wants to maintain it.

Yoonjung Seo contributed to this report.

Read more:

Another American citizen is detained in North Korea, taking total to four

In South Korea, mystification over Trump’s defense and trade comments

Smog becomes a political issue in South Korean election

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news