Moon, the Democratic Party's candidate to replace ousted President Park Geun-hye, was declared the winner by the country's National Election Commission. With 100% of the votes counted, Moon won with 41.08%, the commission said.
According to the commission, 13,423,800 voters selected Moon Jae-in as their preference for President.
The election of Moon, a 64-year-old former human rights lawyer, is likely to mean an overhaul for Seoul's policy on North Korea. Unlike his hard-line conservative predecessor, he favors engagement with Pyongyang and has challenged the deployment of a controversial US missile defense system
"This is the great victory for the great people who have been with me to build a just country, united country and a country where principle and common sense works, Moon said.
Speaking at Democratic Party headquarters following an exit poll announcement that showed him well ahead of conservative Hong Jun-pyo and centrist Ahn Cheol-soo, respectively, Moon said he was expecting a "landslide victory." He said his win came from the "desperation of the people for a new government."
South Koreans were seeking to fill the void left by the impeachment of Park, who was ejected from office in March after a corruption scandal for which she's awaiting trial.
Moon, viewed as a "clean" candidate
by many voters, narrowly lost to Park in 2012.
corruption and the economy were major issues going into the election
, followed by North Korea. Moon's policy on Pyongyang came in for criticism from his rivals, particularly Hong of the Liberty Korea Party and Ahn of the People's Party, who both touted tougher lines on North Korea.
Ahead of the vote, Pyongyang issued a series of state media editorials calling for a boycott of conservative parties.
With Park, US President Donald Trump would have had a partner willing to take a hard line on Pyongyang. But Moon could shake up the status quo in Seoul.
He was a strong proponent
of the "Sunshine Policy," an attempt to improve relations between the two Koreas from 1998 to 2008, and was chief of staff to former South Korean President Roh Moo-hyun.
Liam McCarthy-Cotter, a specialist in East Asian politics at Nottingham Trent University, said there was a need for South Korea "to re-establish its strength both domestically and in the face of increasingly hostile posturing from North Korea."
"Moon is arguing for a new approach to both foreign and domestic policy that will signal a departure from the strategies deployed by his more conservative predecessors," he said, adding that Moon's predicted wide margin of victory would give him a "clear mandate to start reshaping the politics of the peninsula."
More than 11 million people -- about 26% of the electorate -- participated in early voting, according to the national election committee. At the close of polling, an estimated 75% of South Koreans had cast their votes, according to the National Election Commission, though that figure is expected to change.
South Koreans were faced with a daunting list of 15 candidates; however, two dropped out before Election Day.
The hasty election came after Park, the country's first female President, was impeached in a corruption scandal
that also swept up top officials from business giants Samsung and Lotte Group
Many voters said they were angry at Park and wanted greater transparency. "The electorate wants to punish the whole party for the misrule of the Park era," said John Delury, a professor at Yonsei University.
Neighbors' views on the election
North Korean state media took a shot at the departing conservative government the day before the vote.
"The tragic North and South Korean relationship had been brought on by the conservative groups, which have been in power for the past 10 years. They revived the period of confrontation and maximized the political and military confrontation," a commentary in the state-run Rodong Sinmun newspaper said.
"If the conservative clique is to come into power again, the tragedy will be extended," said the piece credited to a personal contributor named Shim Chol Yong.
Some analysts said North Korea has toned down its provocations toward the South ahead of the election to avoid emboldening the country's hard-line conservatives.
"I have always attached great importance to South Korea as well as China-South Korean relations," Chinese President Xi Jinping said, according to the country's Ministry of Foreign Affairs.
"China is willing to work with South Korea to preserve hard-earned achievements in bilateral ties."
What voters wanted
Despite the global focus on North Korea, the biggest priorities for South Koreans were the economy and corruption.
"We saw recently a slightly bad side of our government," said college student Nam Woo-hyu, 26. He said the most important issues for him were "the job market for young people and economic development."
Although she is too weak to walk, 87-year-old Lim Sung-ryeom said she wanted to vote because she was "very concerned" about her country.
"It was a very tough day for me to come all the way to the polling station. But I cannot miss my chance of making a great country," she told CNN.
Some older voters said they were concerned about the prospect of a liberal leader such as Moon coming to power.
Yoon Ji-na, mother to a 18-month-old daughter, told CNN after casting a vote that she came out in the hope she could help the nation return to normal. "I don't have high hopes. But things cannot go worse, right?"