Washington/Seoul: Donald Trump and Kim Jong Un agreed to restart nuclear talks after an hour-long meeting Sunday which saw Trump become the first American leader to set foot in North Korea while in office.

Trump hailed ties with Kim, whom he has now met three times, and invited him to visit the White House. The meeting was hastily planned after the president issued an offer on Saturday via Twitter for Kim to join him at the Demilitarized Zone that separates the two Koreas.

Kim said he was “surprised" by Trump’s request to meet, and called the US president’s short walk over the demarcation line into North Korea “a very courageous and determined act."

Teams from each side will resume talks over the next few weeks “and we’ll see what happens," Trump told reporters at the DMZ. He said sanctions would remain for now but suggested some could be lifted in the course of the negotiations. South Korean President Moon Jae-in, who took part in at least some of the meeting, praised Trump’s “bold, drastic, creative approach.

“We want to get it right," Trump said of nuclear talks that had been stalled for months since a failed summit with Kim in Vietnam. “We’re not looking for speed. We want to get it right."

“The relationship that we’ve developed has meant so much to so many people," he told reporters, standing next to the North Korean leader. He thanked Kim for showing up, saying his willingness to meet on short notice “made us both look good."

While Trump has met Kim twice before at summits in Singapore and Hanoi, no US president has ever sat down with a North Korean leader at the DMZ. Trump made his audacious invitation to Kim while in Japan for the Group of 20 summit, jolting the gathering of world leaders as well as officials in the US and Seoul.

“I saw that tweet and it felt like you’ve sent a flower of hope for the Korean Peninsula," Moon told Trump on Sunday. “If you shake hands with Chairman Kim Jong Un at the Military Demarcation Line, it would be historic, just by the picture of it.'

Trump and Kim have maintained friendly relations despite failing to agree on a path forward to a deal that would ease sanctions in return for steps toward eliminating North Korea’s nuclear threat. Their Hanoi meeting collapsed after Trump refused Kim’s demand for sanctions relief in exchange for only dismantling his main nuclear complex at Yongbyon.

‘Starting point’

Moon said on Sunday that if Kim were to “sincerely, completely" dismantle Yongbyon, the international community would be able to discuss easing sanctions.

“It’ll be the starting point for an irreversible denuclearization," he said.

Trump defended his meetings with Kim and claimed that his predecessor, Barack Obama had sought a meeting with the North Korean leader and been refused.

“A lot’s been done," he said, citing Kim’s restraint from testing nuclear weapons and long-range ballistic missiles since talks first began. “President Obama wanted to meet and Chairman Kim would not meet him. They were begging for meetings constantly."

Ben Rhodes, who was Obama’s deputy national security adviser, said in a tweet the former president never sought to see Kim. “Trump is lying," Rhodes said. “Foreign policy isn’t reality television it’s reality."

US relations with North Korea took a significant turn for the worse in 2009 after Pyongyang evicted international inspectors from Yongbyon and resumed development of nuclear weapons and ballistic missiles.

During meetings with Moon and his visit to the DMZ, Trump repeatedly complained he hasn’t received enough credit for lowering tensions with North Korea, and exaggerated the state of relations with the country before he took office.

“It was a fiery mess," he said. “Bad things were going on. The last administration was nothing but trouble."

“We are so far advanced from where we were" in 2016, Trump said. He has repeatedly claimed the US and North Korea would be at war if former Secretary of State Hillary Clinton had defeated him for the presidency.

“What’s happened is there was nuclear testing, there was ballistic missile testing, they had hostages of ours, as you know," he said. “Very tough situation. And now we’re getting back our remains. We got back the hostages. There’s been no ballistic missile tests. And there’s been no nuclear tests. And South Korea’s a whole different place. And Japan."

Meaningful handshake

Throughout their meetings on Sunday morning, Trump and Moon both appeared unsure whether Kim would appear. The US president cautioned the logistics were complicated, and he said any meeting would be little more than a photo op.

“Chairman Kim wants to do it," he said. “A handshake means a lot," he added.

Moon accompanied Trump to the DMZ but it wasn’t clear how much of it he was invited to attend. Kim’s regime has scoffed at Seoul’s attempts to act as an intermediary in negotiations with Trump.

“The South Korean authorities would better mind their own internal business," North Korea’s news agency KCNA said last week, citing a foreign ministry official.