Moon Jae-in has taken the oath of office in Seoul hours after starting work as South Korea's new president.
He won the presidential by-election to replace ousted leader Park Geun-hye, who now awaits a corruption trial in jail.
The election commission said Mr Moon gained 41% of the votes, comfortably beating conservative Hong Joon-pyo and centrist Ahn Cheol-soo, who gathered 24% and 21& respectively.
After celebrating his victory with thousands of supporters in wet Seoul streets, he began the job of leading a nation deeply split over its future and faced with growing threats from North Korea and an uneasy alliance with the United States.
He said he is willing to visit North Korea's capital Pyongyang under the right conditions.
Mr Moon also said that he will negotiate with the US and China, Seoul's top trading partner, over a contentious US missile-defence system deployed in the South. Beijing says the system allows Washington to spy on China's military operations.
Mr Moon took the oath of office in a ceremony at the National Assembly, and among his first tasks will be naming his nominee for prime minister, the country's second most important job, which needs the approval of politicians.
His election victory followed one of the most turbulent political stretches in the nation's recent history and set up its first liberal rule in a decade.
The new president visited the National Cemetery in Seoul with his wife, Kim Jeong-sook.
After bowing to honour the former presidents, independence fighters and war heroes at the cemetery, Mr Moon wrote in the visitor book: "A country worth being proud of; a strong and reliable president!"
South Korea might see a sharp departure from recent policy under Mr Moon, who favours closer ties with North Korea.
He says hardline conservative governments did nothing to prevent the North's development of nuclear-armed missiles and only reduced South Korea's voice in international efforts to counter Pyongyang.
This softer approach might put him at odds with South Korea's biggest ally, the US. The Trump administration has swung between threats and praise for North Korea's leader.
Mr Moon, the child of refugees who fled North Korea during the Korean War, will lead a nation shaken by the scandal that felled Ms Park, whose criminal trial is scheduled to start later this month.
Without the usual two-month transition, Mr Moon initially will have to depend on her cabinet ministers and aides, but he is expected to move quickly to replace them with people of his own.
He will not serve the rest of Ms Park's term but rather will serve out the typical single five-year term.