Image copyright AFP Image caption Moon Jae-in is South Korea's new president

South Korean President Moon Jae-in has led the country into a historic engagement with the North hoping to cool tensions on the peninsula and solve the nuclear threat from Pyongyang.

He was swept to victory in 2017 after a corruption scandal had driven his predecessor Park Geun-hye out of office.

Ms Park has since been sentenced to prison 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 - is leading the country through tumultuous and historic times.

Fleeing south

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 the authoritarian rule of Park Chung-Hee - Park Geun-hye's father. He was sent to jail, where he passed the bar and was eventually released.

Image copyright EPA Image caption Mr Moon - pictured here with his wife Kim Jung-sook during his college days - was jailed for student activism

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.

Here, his former colleague Seol Dong-il remembers him for having "a distinctly nerdy style", spending hours preparing for court.

Image copyright EPA Image caption By 1987 Mr Moon was a human rights lawyer and leader within the pro-democracy movement

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".

Image copyright EPA Image caption Mr Moon (far right) was a top aide to former president and close friend Roh Moo-hyun (far left)

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.

Image copyright Getty Images Image caption Mr Moon, along with former chief of staff Lee Byung-Wan, carried a picture of Mr Roh after his death

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.

Image copyright EPA Image caption Mr Moon, pictured here with his North Korean relatives, dreams of visiting his mother's hometown with her

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.

Finding a way forward with North Korea has been high on his to-do list and his chance to pursue this ambition came in January 2018.

In his New Year speech, North Korean leader Kim Jong-un announced his country might take part in the upcoming South Korea Olympics. The talks that followed then led to the plans for the third ever inter-Korean summit and for talks between US President Trump and Mr Kim in the next months.

The rapid and largely unexpected rapprochement with the North will likely mark his presidency. While Mr Moon's political gamble is not without risks, it is also seen as the president's chance at leaving a historic legacy.

In a book released last year, the president 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."