South Korea's opposition presidential candidate Yoon Suk-yeol was projected to win Wednesday's election, broadcaster KBS said, with nearly 90% of votes counted, a race that will shape Asia's fourth-largest economy for the next five years.
Conservative Yoon, with 48.6%, was slightly ahead of liberal Lee Jae-myung on 47.8%, with more than 89% of the ballots counted as of 2.30 a.m. on Thursday (1730 GMT Wednesday).
KBS put Yoon's probability of winning the election at about 95%.
The unusually bitter election campaign was marred by scandals and smears, but the policy stakes are high for the country of 52 million.
Around 77% of South Korea's 44 million eligible voters cast ballots to pick the leader of a nation whose global status is rising even as it has been riven by gender and generational divisions, while facing a confrontational North Korea.
The winner must tackle challenges including South Korea's worst wave of COVID-19 infections, growing inequality and surging home prices, while navigating an increasingly tense rivalry between China and the United States.
Voters also want the new president to root out graft and pursue negotiations to curb North Korea's nuclear ambitions.
Lee, the standard-bearer of the ruling Democratic Party, and Yoon, from the conservative main opposition People Power Party, are vying to succeed incumbent President Moon Jae-in, who is constitutionally barred from seeking re-election.
An exit poll jointly conducted by KBS and two other major broadcasters had shown Yoon's 0.6% lead with 48.4%, and another one by cable network JTBC put Lee ahead with 48.4% to Yoon's 47.7%.
The exit polls suggested Lee had performed better than expected. Surveys last week had given Yoon the edge after he secured the support of a fellow conservative who had been trailing a distant third and then quit the race.
LEE SURPRISES IN SEOUL
Lee was seen garnering more votes than expected in Seoul, home to some 8.3 million voters, winning 45.4% in the joint exit poll compared with Yoon's 50.9%. Earlier polls had given Yoon a lead of up to 10 percentage points in the capital.
Cheers and applause erupted at the Democrats' office when the exit polls were released. Party leader Song Young-gil, who wore a bandage after being assaulted at a rally this week by a man with a hammer, shed tears.
Lee had maintained a tight lead during initial counting, but Yoon began narrowing the gap and surpassed him after midnight when about 50% of the ballots were counted.
A nationwide win by the conservative opposition would represent a remarkable turnaround for a party that was in disarray after the last election in 2017, held early after the impeachment and dismissal of President Park Geun-hye.
Moon's liberal Democratic Party is fighting to protect and continue his agenda, and also to head off threats by Yoon to investigate the outgoing administration for graft if elected.
The two presidents before Moon, including Park, were imprisoned after they left office. Moon faces no specific allegations of wrongdoing, but some of his closest aides were engulfed in corruption scandals.
A former prosecutor general, Yoon has vowed to fight corruption, foster justice and create a more level playing field, while seeking a harder line towards North Korea and a "reset" with China.
Lee was governor of the most populous province of Gyeonggi and shot to fame with his aggressive coronavirus response and advocacy of a universal basic income.
'UNLIKEABLE ELECTION'
Both candidates' disapproval ratings matched their popularity as scandals, mud-slinging and gaffes dominated what was dubbed the "unlikeable election".
Young voters who backed Moon but became disillusioned over economic woes and the scandals are regarded as a key bloc.
"As current problems for young people concerning employment and housing prices are serious, I voted for a candidate who made a pledge to come up with solutions," Lee Sung-jin, 33, said as he cast his vote in Seoul. He did not say whom he backed.
South Korea is facing a surge in new COVID-19 cases - with a record 342,446 reported on Wednesday - but the issue did not register much in the campaign.
(Reporting by Hyonhee Shin; Additional reporting by Josh Smith, Daewoung Kim and Yeni Seo; Editing by Robert Birsel, Clarence Fernandez, Mark Heinrich, Alex Richardson and Nick Macfie)