SEOUL, South Korea — A conservative former prosecutor declared victory in South Korea’s presidential election on Thursday after his liberal ruling party rival conceded defeat following a bitter battle in the politically divided nation.

With around 98% of the ballots counted as of 4:00 a.m., People Power Party candidate Yoon Suk Yeol won 48.59% of the votes, with liberal rival Lee Jae-myung garnering 47.80%.

Yeol thanked his supporters outside his home in capital Seoul after what he described as a “long night.” He spoke shortly after Jae-myung conceded defeat during a news conference at the campaign office of his Democratic Party, where he congratulated Yeol and called for him to heal the country’s divisions.

Yeol will take office in May and serve a single five-year term as leader of the world’s 10th largest economy, which is now grappling with stark income inequalities and soaring personal debt, and is facing growing threats from nuclear-armed North Korea.

While Lee and Yoon have some similar economic and welfare policies, they clashed over North Korea and other foreign policy issues.

Yoon says he will sternly deal with North Korean provocations and seek to boost trilateral security cooperation with the United States and Japan.

On confrontation between the U.S. — South Korea’s top military ally — and China — its biggest trading partner — Yoon wants to enhance the alliance with the former.

After North Korea’s latest reported ballistic missile launch on Saturday, Yoon accused North Korean leader Kim Jong Un of trying to influence the results of the South Korean election in favor of Lee. “I would [teach] him some manners and make him come to his senses completely,” Yoon told a rally near Seoul.

South Korean law limits a president to a single five-year term, so Lee’s party colleague, President Moon Jae-in, could not seek reelection. Moon came to power in 2017 after conservative President Park Geun-hye was impeached and ousted from office over a corruption scandal.

Yoon’s critics have attacked him over a lack of experience in party politics, foreign policy and other key state affairs. Yoon has responded that he would let experienced officials handle state affairs that require expertise.

More In Asia Pacific