Media playback is unsupported on your device Media caption Donald Trump and Kim Jong-un: From enemies to frenemies

North Korean leader Kim Jong-un and US President Donald Trump are to meet in person by May, it has been announced, an extraordinary overture after months of mutual hostility.

News of the meeting was delivered by South Korean officials after talks with Mr Trump at the White House.

They passed a verbal message from Mr Kim, saying the North Korean leader was "committed to denuclearisation".

Mr Trump hailed "great progress" but said sanctions would remain in place.

South Korea's President Moon Jae-in said the news "came like a miracle".

"If President Trump and Chairman Kim meet following an inter-Korean summit, complete denuclearisation of the Korean peninsula will be put on the right track in earnest," he said.

Media playback is unsupported on your device Media caption Envoy Chung Eui-yong speaks to reporters outside the White House

China has welcomed the development, saying the Korean peninsula issue was "heading in the right direction" and calling for "political courage".

However, correspondents say the North has halted missile and nuclear tests during previous talks, only to resume them when it lost patience or felt it was not getting what it demanded.

The latest announcement came days after the South Korean delegation met Mr Kim in Pyongyang.

Speaking outside the White House after briefing Mr Trump, South Korean National Security Adviser Chung Eui-yong said he had passed on a message that Mr Kim was "committed to denuclearisation" and had "pledged that North Korea will refrain from any further nuclear or missile tests".

In a statement sent to the Washington Post, North Korea's UN ambassador said the "courageous decision" of Mr Kim would help secure "peace and stability in the Korean Peninsula and the East Asia region".

There is no indication yet of where the Trump-Kim talks might take place, but the Korean border's demilitarised zone (DMZ) and Beijing are seen as likely options.

US Secretary of State Rex Tillerson said it would take "some weeks" to arrange the talks and admitted the US had been "surprised" at Kim Jong-un's "forward-leaning" stance.

Just a day earlier, Mr Tillerson had said the US was "a long way" from negotiations with the North.

Moon's huge gamble

Analysis by BBC's Laura Bicker in Seoul

President Moon Jae-in has acknowledged there are obstacles ahead. He is managing expectations and so much can go wrong.

His approval ratings took a hit during the Winter Olympics after he integrated the women's hockey team with players from the North and met a general from Pyongyang who had been accused of masterminding deadly attacks on South Koreans, though they have since rebounded.

These talks are a huge gamble with a communist state which is hard to read.

But if, just if, he helps pull it off, it may reduce the threat of nuclear war and he could win himself a Nobel Peace prize.

If all fails, it is back to brinkmanship.

Read Laura's piece in full

How did we reach this point?

North Korea has been isolated for decades because of its well-documented human rights abuses and its pursuit of nuclear weapons, in defiance of international laws.

It has carried out six nuclear tests, and has missiles that could reach the US.

But South Korea's hosting of the Winter Olympics gave an unexpected window for diplomacy.

South Korea then held landmark talks with Mr Kim in Pyongyang this week, returning home saying the North was willing to give up its nuclear weapons if it felt it had no reason to keep them.

What has North Korea pledged?

There were four main elements to the statement delivered by Mr Chung:

Mr Kim is prepared to sit down with the US president

North Korea is "committed to denuclearisation"

It will halt all nuclear and missile tests

It understands that US-South Korean military drills "must continue".

South Korea statement on Kim-Trump meeting in full

The BBC's Laura Bicker in Seoul says it is important to note that North Korea has not yet promised to abandon its nuclear weapons completely.

Image copyright PA Image caption North Korea's charm offensive during the Winter Olympics included deploying its famed cheerleading squad at matches

It also remains unclear exactly what it is asking for in return.

Is this a victory for Trump?

Mr Trump has repeatedly belittled Kim Jong-un, and last year threatened him with "fire and fury" if North Korea continued to threaten the US. He has at times said there is no point in talking to North Korea.

But Mr Chung made a point of saying it was Mr Trump's "maximum pressure policy" which had brought the parties to this point, a gesture which the president is likely to appreciate.

Our correspondent says Kim Jong-un has also scored a propaganda win, first with the Olympics and now by being seen to reach out to the US.

Former British ambassador to North Korea, John Everard, told the BBC there must be a suspicion that Mr Kim might be trying to play Mr Trump, to try to "get him to say across the table things that North Korea has been asking for for a long time".

Image copyright Getty Images Image caption The South Korean-US drills are a source of intense frustration for Pyongyang

These could include a peace treaty to finally end the Korean War and a promise that if North Korea denuclearised then the US would finally withdraw its troops from South Korea.

The US has tens of thousands of military personnel there and the massive annual joint war games infuriate the North, because it believes they are preparation for invasion.

What about the other major players?

President Moon, who is due to meet Mr Kim in April, said the Trump-Kim meeting "will be recorded as a historic milestone that realised peace on the Korean peninsula".

The South's statement also credited "international solidarity" for the breakthrough, probably in part a reference to the ever-increasing international sanctions on North Korea.

Image copyright AFP Image caption The heavily guarded DMZ has been the location of landmark talks in the past

China, North Korea's main economic supporter, has in recent months toughened up its dealings with Pyongyang, including on key areas like petroleum and oil. This is thought to be putting a major strain on the North.

Beijing has consistently pushed for all parties to talk and on Friday, China's foreign ministry spokesman Geng Shuang said it welcomed the "positive signals" from the US and North Korea.

"We're glad that they have finally made this first step... The next key step is for all parties to maintain this momentum," Mr Geng said.

Russian Foreign Minister Sergei Lavrov said the development was a "step in the right direction".

"It should not just be a meeting, it should open up a way to resuming a fully fledged diplomatic process to find a solution to the North Korean nuclear issue," he said.

Japan, which saw North Korean missiles fly over its territory twice last year, responded with cautious optimism.

Prime Minister Shinzo Abe said Japan would "keep putting maximum pressure until North Korea takes concrete actions toward denuclearisation", and said he hoped to meet Mr Trump ahead of the Kim summit.

Have talks like this happened in the past?

No sitting US president has ever met a North Korean leader, but there have been repeated attempts to get North Korea to denuclearise.

The last major effort - the Six Party talks - collapsed in 2008, largely because North Korea refused to allow inspectors to verify that it had shut down its nuclear programme.

A number of bids to restart the talks also collapsed, including in 2012 when North Korea launched another rocket, two weeks after announcing a "leap day" (29 February) agreement with the US that had promised food aid in return for inspections and a moratorium on missile tests.