Moon Jae-in: Who is South Korea's new president?
Moon Jae-in has swept to victory in South Korea, leaving his nearest rival trailing in his wake.
Just who is this man who once spent time in jail for protesting against the father of his predecessor, Park Geun-hye?
Ms Park is now the one in prison, awaiting trial on charges she denies, while Mr Moon - the son of refugees from the North, who spent his first years strapped to his mother's back as she sold eggs to make ends meet - prepares to lead the country.
Mr Moon's parents fled the North during the Korean War. By the time he was born in 1953, they were living on the southern island of Geoje.
According to his autobiography, his father worked at a prisoner-of-war camp while his mother sold eggs in the port city of Busan.
In 1972, Mr Moon entered law school but he was not there for long.
Mr Moon was arrested for leading the protests against Park Chung-Hee's authoritarian rule. He was sent to jail, where he passed the bar and was eventually released.
By 1976, Mr Moon had been conscripted to the South Korean army. He took part in South Korea's military operation in response to the killing of two US officers, whom North Korean soldiers attacked for trimming a tree.
Six years later, he and his friend - and another future president - Roh Moo-hyun opened a law firm in the city of Busan, which focused on human and civil rights issues.
- Why South Korea's corruption scandal is nothing new
- South Korea's 'life or death' presidential election
- Why the economy is top priority
Here, his former colleague Seol Dong-il remembers him for having "a distinctly nerdy style", spending hours preparing for court.
But Mr Seol also remembers the care with which he treated those who came to him for help.
"When workers sought advice from him, Moon used to sit down for hours to listen to them," Mr Seol told Reuters news agency.
A new start
Mr Moon and Mr Roh became leading figures in the pro-democracy movement which swept the country and led to South Korea's first democratic election in 1987.
But while Mr Roh, who came from a humble farming family, entered the world of politics, Mr Moon chose to stay in Busan and continue the fight through the courts.
In 2003, Mr Roh was elected president; Mr Moon became one of his top aides - earning him the nickname "Shadow of Roh".
On the campaign trail in 2004, Mr Moon was, according to former politician Choi Nak-jeong, "very shy" and a "ridiculously awkward" figure.
Mr Moon would later appear to agree, writing in 2011: "I always felt uncomfortable. I felt that the job was not suitable for me, as if I was wearing clothes that did not fit. I always thought 'I will go back to my place, a lawyer'."
His time in Mr Roh's government - where he was tasked with weeding out corruption - was not without controversy. In 2007, he came under fire over allegations that the government of then-President Roh had consulted North Korea before abstaining from a UN vote on a human rights resolution against the North in 2007.
Mr Moon has denied the allegations.
Then, in 2009, Mr Roh committed suicide after leaving office as corruption investigators closed in over allegations he had accepted $6m ($4.6m) in bribes.
Mr Moon was deeply affected by his death. In his 2011 memoir, he wrote: "When I drink a little, I sometimes recall my old days. Then I ask myself: 'What does Roh Moo-hyun mean in my life?'
"He really defined my life. My life would have changed a lot if I didn't meet him. So he is my destiny."
Seemingly with this in mind, Mr Moon, who is married with two children, decided to take up his long-time friend's mantle after Mr Roh's death. He first ran for president in 2012, when he lost narrowly to Ms Park.
He did, however, win the MP's seat in Busan.
And then, on 9 May 2017 - more than two decades after he helped lead the country to its first democratic elections - Mr Moon was voted in as president.
What his tenure will mean for the country remains to be seen. However, finding a way forward with North Korea will be high on his to-do list.
In a book released this year, Mr Moon revealed he still dreamed of returning to his parent's North Korean home town, Hungnam.
"I was thinking I wanted to finish my life there in Hungnam doing pro bono service," he wrote. "When peaceful reunification comes, the first thing I want to do is to take my 90-year-old mother and go to her home town."