Conservative Park Geun-hye has become South Korea's first female president.
The liberal Moon Jae-in conceded to the daughter of late dictator Park Chung-hee after a close race.
Her victory came despite analysts' speculation that high voter turnout could favour Mr Moon, who is the son of North Korean refugees and a former human rights lawyer.
Ms Park says she is open to dialogue with North Korea but calls on Pyongyang to show progress in nuclear dismantlement.
The five-term lawmaker drew support from a conservative base of older voters with fond memories of South Korea's rise from poverty during her father's 18-year rule.
She will replace conservative President Lee Myung-bak in February.
She is unmarried and has no children, and said her life will be devoted to her country.
Her father was former president Park Chung-hee, and the admiration for him felt among older voters appears to have been translated into support for his daughter.
She has spent 15 years in politics as a leading legislator in the country's ruling Saenuri party, although her policies remain sketchy.
Ms Park has a "Happiness Promotion Committee" and her campaign was launched as a "National Happiness Campaign", a slogan she has since changed to "A Prepared Woman President".
She has said she would negotiate with North Korean leader Kim Jong-un but wants it to give up its nuclear weapons programme as a precondition for aid, something Pyongyang has refused to do.