Washington — 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 landed at Andrews Air Force Base outside Washington on 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 US, it could also be aimed at getting 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 three 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 the 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 the 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 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 as a “positive gesture of goodwill” ahead of the planned summit, the White House said. It is planned for late May or early June.