South Korean voters have overwhelmingly chosen the liberal candidate Moon Jae-in as their next president, an exit poll suggests.
It put Mr Moon on 41.4%, with his nearest challenger, conservative Hong Joon-Pyo, on 23.3%.
Mr Moon favours greater dialogue with North Korea, in a change to current South Korean policy.
The early election was called after a corruption scandal led to the impeachment of the former president.
Park Geun-hye is accused of allowing a close friend to extort money from companies. She denies all wrongdoing.
Record turnout was expected and if Mr Moon’s victory is confirmed he is likely to be sworn in on Wednesday.
Who is he?
The son of a refugee from North Korea, Mr Moon was jailed while a student in the 1970s for leading protests against military ruler Park Chung-hee – Ms Park’s father.
Later, he served in South Korea’s special forces before becoming a human rights lawyer.
Mr Moon, of the Democratic Party of Korea, unsuccessfully ran against Ms Park in 2012 elections.
He has positioned himself as the man who can move the country on from the scandals of Ms Park’s era.
“I feel that not only my party and myself but also the people have been more desperate for a change of government,” he said while casting his vote earlier on Tuesday.
What are his policies?
Mr Moon has advocated greater dialogue with the North while maintaining pressure and sanctions, in contrast to Ms Park who cut almost all ties.
He has been critical of the two previous conservative administrations for failing to stop North Korea’s weapons development.
North Korea even tacitly backed Mr Moon’s candidacy, with state media referencing the Sunshine Policy of greater cooperation in the 2000s that Mr Moon was involved in when last in government.
But while tensions on the Korean peninsula ensured the election was closely watched, for South Koreans the priority has been corruption and the economy, with youth unemployment stubbornly high.
Mr Moon has talked of reforming South Korea’s huge family-run conglomerates, known as chaebols, which dominate the domestic economy.
South Korea presidency ‘won by liberal Moon Jae-in’}