South Koreans are voting for a new president to replace Park Geun-hye, who was forced out after a huge corruption scandal.
The favourite is a liberal candidate who has pledged to improve ties with North Korea, re-examine a contentious US missile shield, and bring in sweeping economic changes.
Conservatives worry that a victory by Moon Jae-in might benefit North Korea and estrange South Korea from its most important ally, the United States.
Mr Moon, 64, was the clear favourite as conservative forces struggled to regroup after the scandal ended Ms Park's presidency.
He said after casting his vote: "I gave all my body and soul (to the election) to the very end. My party and I invested all our efforts with a sense of desperation, but we also felt a great desire by people to build a country we can be proud of again."
The final opinion surveys released last week showed Mr Moon, the Democratic Party candidate, had about a 20 percentage-point lead over his two main rivals - a centrist and a conservative.
His victory would end a near-decade of conservative leadership by Ms Park and Lee Myung-bak.
Mr Moon was chief of staff for the last liberal president Roh Moo-hyun, who sought closer ties with North Korea by setting up large-scale aid shipments to the North and by working on now-stalled joint economic projects.
Outspoken conservative Hong Joon-pyo, the candidate from Ms Park's Liberty Korea Party, described the election as a war between ideologies and accused Mr Moon of being aligned with North Korea.
Mr Hong said the election was a "war of regime choices between people, whether they decide to accept a North Korea-sympathising leftist government or a government that can protect the liberty of the Republic of Korea," South Korea's formal name.
The polls have shown him even with centrist Ahn Cheol-soo.
The winner will be sworn in after the National Election Commission ends the vote count and confirms the result on Wednesday.
Because the vote is a special election, the new president will forgo the usual two-month transition and will serve one full, five-year term rather than only completing Ms Park's original term, which was to have ended in February 2018.
Ms Park, South Korea's first female president, is in a detention facility near Seoul and awaits a criminal trial set to start later this month.
She has been indicted on bribery, extortion and other corruption charges, which could send her to jail for life if she is convicted.
Mr Moon, who lost the 2012 election to Ms Park by a million votes, frequently appeared at rallies against her, and the corruption scandal boosted his push to re-establish liberal rule.
He called for reforms to clean up social inequalities, excessive presidential power and corrupt ties between politicians and business leaders.
Many of those legacies dated to the dictatorship of Ms Park's father, Park Chung-hee, whose 18-year rule was marked by both rapid economic rise and severe civil rights abuse.