North Korea released three American detainees and handed them over to US Secretary of State Mike Pompeo on Wednesday, clearing a major obstacle to an unprecedented summit between President Donald Trump and North Korean leader Kim Jong Un.

Trump said the three men, who were freed after Pompeo met Kim, were on the way home from Pyongyang on the chief US diplomat's plane. The president planned to greet them when they land at Andrews Air Force Base outside Washington at 2 a.m. EDT (0600 GMT) Thursday morning.

The release appeared to signal an effort by Kim to set a more positive tone for the summit and followed his recent pledge to suspend missile tests and shut Pyongyang’s nuclear bomb test site.

While Kim is giving up the last of his remaining American prisoners who North Korea has often used in the past as bargaining chips with the United States, it could also be aimed at pressuring Trump to make concessions of his own in his bid to get Pyongyang to abandon its nuclear arsenal.

‘I am pleased to inform you that Secretary of State Mike Pompeo is in the air and on his way back from North Korea with the 3 wonderful gentlemen that everyone is looking so forward to meeting. They seem to be in good health,’ Trump wrote in a post on Twitter.

The family of Tony Kim, one of freed prisoners, thanked Trump, saying in a statement: ‘We are very grateful for the release of our husband and father, Tony Kim, and the other two American detainees.’

South Korea heralded the move as positive for upcoming talks between Trump and Kim and called on Pyongyang to also release six South Korean detainees.

The fate of the three Korean-Americans - including Kim Hak-song and Kim Dong-chul - had been among a number of delicate issues in the run-up to the first-ever meeting of US and North Korean leaders.

As Pompeo returned to his Pyongyang hotel from a 90-minute meeting with Kim, the secretary of state crossed his fingers when asked by reporters if there was good news about the prisoners.

A North Korean official came to the hotel shortly afterwards to inform Pompeo that Kim had granted their release, according to a senior US official present for the exchange.

Pompeo replied: ‘That's great,’ according to the official.

‘You should make care that they do not make the same mistakes again,’ the North Korean official was quoted as saying. ‘This was a hard decision.’

They were in the air less than an hour after leaving custody.

Trump viewed the release of the three Americans as a ‘positive gesture of goodwill’ ahead of the planned summit, the White Hosue said. It is planned for late May or early June.

The White House said the health of the three Americans appears to be in good condition and all were able to walk without assistance onto the plane.

Until now, the only American released by North Korea during Trump's presidency has been Otto Warmbier, a 22-year-old university student who returned to the United States in a coma last summer after 17 months of captivity. He died days later.

Warmbier's death escalated US-North Korea tensions, already running high at the time over Pyongyang's stepped-up missile tests.

The three newly released prisoners are Korean-American missionary Kim Dong-chul; Kim Sang-duk, also known as Tony Kim, who spent a month teaching at the foreign-funded Pyongyang University of Science and Technology (PUST) before he was arrested in 2017; and Kim Hak-song, who also taught at PUST.

North Korean state media says they were detained either for subversion or committing ‘hostile acts’ against the government.

The upcoming US-North Korea summit has sparked a flurry of diplomacy, with Japan, South Korea and China holding a high-level meeting in Tokyo on Wednesday.

However, North Korea reminded the United States on Wednesday there still was tension between them, warning it against ‘making words and acts that may destroy the hard-won atmosphere of dialogue,’ the North's state media said.

‘The US is persistently clinging to the hostile policy toward the DPRK, misleading the public opinion. Such behaviour may result in endangering the security of its own country,’ it added, referring to the North's official name, the Democratic People's Republic of Korea.

Related Story