The three Americans headed back to the US after being released by North Korea have thanked President Donald Trump and Secretary of State Mike Pompeo for securing their freedom.

In a major diplomatic coup for Donald Trump, Kim Dong-cheol, Kim Sang-deok and Kim Hak-seong, who have been imprisoned by the rogue regime for between one and three years, were all released on Wednesday.

"We would like to express our deep appreciation to the United States government, President Trump, Secretary Pompeo, and the people of the United States for bringing us home," the three said in a statement released by the State Department.

"We thank God, and all our families and friends who prayed for us and for our return. God Bless America, the greatest nation in the world."

The exchange came as Mike Pompeo, the US secretary of state, made a second visit to North Korea in as many months, spending 13 hours on the ground locked in talks.