U.S. Secretary of State Mike Pompeo arrived in North Korea on Wednesday to finalize details of a historic summit planned between President Donald Trump and North Korean leader Kim Jong-un.

Trump announced the mission in Washington on Tuesday just minutes before Pompeo arrived in Japan to refuel before flying on to Pyongyang, and as the president declared he was withdrawing from a landmark nuclear deal with another bitter U.S. adversary, Iran.

The trip is Pompeo's second known visit to the country. Trump revealed last month that Pompeo also met with Kim over Easter weekend.

Trump says the time and date of his planned meeting with Kim have been agreed to, but he has yet to reveal where or when it will happen.

"We think relationships are building with North Korea," he told reporters. "We'll see how it all works out — maybe it will, maybe it won't."

As he left, reporters asked about three Americans — Kim Hak-song, Tony Kim and Kim Dong-chul — detained in North Korea.

Trump didn't answer directly, but turned to face the reporters as he walked away and said, "We'll all soon be finding out. It would be a great thing if they are; we'll soon be finding out."

Pompeo, speaking to reporters en route to Pyongyang, said he had not received a commitment for their release but hoped North Korea would "do the right thing."

Their release could signal an effort by Kim to set a more positive tone for the summit following his recent pledge to suspend missile tests and shut down his country's nuclear bomb test site (though a subsequent report by Chinese geologists suggested the site had partly collapsed, rendering it unusable).

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

"We've been asking for the release of these detainees for 17 months," Pompeo said. "We'll talk about it again. It'd be a great gesture if they'd agree to do so."

Pompeo, who first travelled to North Korea as CIA chief in early April, is only the second sitting secretary of state to visit the reclusive nation with which it is still technically at war. The first was Madeleine Albright in 2000, who went as part of an unsuccessful bid to arrange a meeting between then president Bill Clinton and Kim's father, Kim Jong-il.

The secretary of state told reporters aboard his plane that his first visit was to test North Korea's seriousness of pledges to South Korea on easing tensions. This trip is "to put in place a framework for a successful summit," he said.