South Korea has voted in a new president, former human rights lawyer Moon Jae-in in a move that could see the country taking a more conciliatory approach towards North Korea.

The victory by the liberal politician ends the months of political unrest that eventually led to the impeachment of the former conservative president Park Geun-hye over alleged corruption. Park became the first democratically elected leader in South Korea to be removed from office, which triggered an election for the next president.

Park is awaiting trial for offering governmental favours to top businessmen, including Samsung heir Lee Jae-yong, who allegedly bribed her secret confidante, Choi Soon-sil.

Moon narrowly lost to Park in the last presidential election in 2012.

Moon, who was surrounded by his Democratic Party colleagues, told supporters on Tuesday night at the Gwanghwamun Square in Seoul: "I will make a just, united country. I will be a president who serves all the people who did not support me."

His victory was announced by the main television networks.

With 80% of the votes counted so far, Moon was ahead by a long shot with 40%, said the National Election Commission. His closest rival was former prosecutor Hong Joon-pyo with 25.5% followed by centrist Ahn Cheol-soo with 21.4%.

The results are in line with an exit poll by South Korea's three biggest broadcasters, which show Moon receiving 41.4% of the votes, beating 12 other candidates vying for the country's top post.

Voter turnout was the highest in 20 years at 77.2% but still short of the 80% expected.

A plurality of votes is enough for victory, Reuters reports.

Washington and Tokyo congratulate Moon

Seoul's most important ally on Tuesday congratulated Moon on his victory. "We look forward to working with president-elect Moon to continue to strengthen the alliance between the United States and the Republic of Korea and to deepen the enduring friendship and partnership between our two countries," White House Press Secretary Sean Spicer said in a statement.

Similarly, Japan's Prime Minister Shinzo Abe said: "Japan and South Korea are facing common challenges in East Asia, led by responses to the North Korean issue.

"I believe the two countries can further contribute to peace and prosperity of the region by working together," he added.

Moon accused of being soft on North Korea

South Korea elections and North Korea
Moon Jae-in, the presidential candidate of the Democratic Party of Korea, and his wife Kim Jung-sook gesture after voting at a polling station in Seoul, South Korea Kim Kyung Hoon/Reuters

Moon, has advocated dialogue with North Korea to ease the rising tension in the region. And like US President Donald Trump, Moon has also said that he would be willing to meet Kim Jong-un.

The former lawyer who has been accused of being 'soft on the North' also advocates the resumption of some of the inter-Korean projects that were shuttered by his predecessors, Channel News Asia reports.

Moon, Reuters, notes was a close friend and confidante of the late president Roh Moo-hyun, who advocated the Sunshine Policy of engaging with North Korea through aid and exchanges.

Deployment of Thaad to run into problems?

The deployment of the Terminal High Altitude Area Defence (THAAD) system could face some problems as Moon has criticised the move, saying the decision to deploy it was made too quickly and insisted that the next administration should have the final say on whether the system should be deployed.

In addition, Moon has also vowed to reform powerful family-run conglomerates such as Samsung and Hyundai and boost fiscal spending to create jobs.

Moon is expected to be sworn in as president on Wednesday (10 May) and has said that he will skip a lavish inauguration ceremony, opting instead to start work straight away.

The appointment of a prime minister will require parliamentary approval. The main cabinet posts, which includes national security and finance ministers however do not need parliamentary confirmation, Reuters reports.

Moon's Democratic Party holds 40% of the single-chamber, 299-seat assembly. This effectively means that he will have to work with other parties to have legislation passed.