Moon, whose campaign promises include a "National Interest First" policy, has struck a chord with people who want the country to stand up to powerful allies and neighbours. Photograph: (Reuters)
The Liberal politician is expected to be sworn in as President for a five-year term later on Wednesday.
Liberal politician Moon Jae-in decisively won South Korea's presidential election on Tuesday, television networks declared, an expected victory ending nearly a decade of conservative rule and bringing a more conciliatory approach toward North Korea.
Moon's victory will end months of political turmoil that led to parliament's impeachment of conservative former President Park Geun-hye over an extensive corruption scandal, which a court upheld in March. Park became the first democratically elected leader in South Korea to be removed from office, triggering a snap election to choose her successor.
Climbing a temporary stage set up in the main square in downtown Seoul, a beaming Moon surrounded by his Democratic Party leaders, vowed to usher in a new era for a country badly bruised by the scandal in a midnight victory speech.
"I will make a just, united country," he told a crowd gathered to see the former human rights lawyer who entered politics just five years ago. "I will be a president who also serves all the people who did not support me."
With 80 per cent of the votes counted at 1705 GMT, Moon was ahead with 40 per cent, according to the National Election Commission. A conservative challenger, former prosecutor Hong Joon-pyo, was next with 25.5 per cent followed by centrist candidate Ahn Cheol-soo with 21.4 per cent.
A plurality of votes is enough for victory.
The results were in line with an exit poll by South Korea's three biggest broadcasters, which showed Moon, 64, capturing 41.4 per cent of the votes in a field of 13 candidates.
"If exit polls are true, I will accept the results and just be satisfied with the fact that the Liberty Korea Party will be restored,” a downcast Hong told members of his conservative party.
Ahn said he would "humbly accept" the result.
Voter turnout was 77.2 per cent, the highest in 20 years, but short of the expected 80 per cent mark, as voters headed to the polls in drizzly weather.
Moon is expected to be sworn in for a five-year term later on Wednesday. He has said he would skip a lavish inauguration ceremony and start work straight away.
He is likely to quickly name a prime minister, who will need parliamentary approval. The main cabinet posts, including national security and finance ministers, do not need parliamentary confirmation.
Moon, who narrowly lost to Park in the last presidential election in 2012, favours dialogue with North Korea to ease tension over its accelerating nuclear and missile programme. He also wants to reform powerful family-run conglomerates, such as Samsung and Hyundai, and boost fiscal spending to create jobs.
Moon has criticised the two previous conservative governments for failing to stop North Korea's weapons development. He advocates a two-track policy of seeking dialogue with the North while maintaining pressure and sanctions to encourage change.
His Democratic Party holds 40 per cent of the single-chamber, 299-seat assembly, which will means he will have to build coalitions to pass legislation.
His victory was bolstered by strong support from younger people, according to the exit polls. Many of his supporters participated in big, peaceful weekend rallies over the last few months of 2016 and early this year, demanding Park step down.
Only 22-25 per cent of people in their 60s and 70s voted for Moon, exit polls showed, underscoring a long-standing generation gap. Many older people are wary of Moon's less confrontational stance on North Korea.
South Korea first
The election is being closely watched abroad at a time of high tension with North Korea, which is believed to be preparing for a sixth nuclear test and has vowed to test an intercontinental missile.
Moon, whose campaign promises include a "National Interest First" policy, has struck a chord with people who want the country to stand up to powerful allies and neighbours.
He wrote in a book published in January South Korea should learn to say "no to America".
Moon said in a YouTube live stream on Tuesday that South Korea should take on a more active diplomatic role to curb North Korea's nuclear threat and not watch idly as the United States and China talk to each other.
Moon was a close friend and confidant of late president Roh Moo-hyun, who served from 2003 to 2008 and advocated a "Sunshine Policy" of engaging North Korea through aid and exchanges.
Moon believes better inter-Korean relations is the best way to provide security. But Washington is worried his moderate stance could undercut efforts to increase pressure and sanctions, senior South Korean officials said.
"Things are not right to resume the so-called Sunshine Policy, as the U.S. and China turned more hostile towards North Korea," said Koh Yu-hwan, Dongguk University professor of North Korean studies, who is serving as a foreign policy adviser to Moon.
"Still, Moon is expected to engage in discussions, which could improve North-South relations."
Moon's election could also complicate the deployment of the Terminal High Altitude Area Defence (THAAD) system, which the former government in Seoul and the US military agreed to last year.
Moon has said the decision was made too quickly and the next administration should have the final say on whether to deploy the system.