Two American citizens are on their way home from North Korea after their release from prison there, US intelligence officials said.
Director of National Intelligence James Clapper is accompanying Kenneth Bae and Matthew Miller on their journey back to the US, a spokesman for Mr Clapper said.
Mr Bae and Mr Miller were the last Americans held by North Korea following the release last month of Jeffrey Fowle.
Mr Miller, who is from California, was serving a six-year jail term on charges of espionage after he allegedly ripped his tourist visa at Pyongyang's airport in April and demanded asylum.
Mr Bae, who is from Washington state, is a Korean-American missionary with health problems. He was serving a 15-year sentence for alleged anti-government activities.
North Korea said Mr Miller had wanted to experience prison life so that he could secretly investigate the country's human rights situation.
Mr Bae was detained in 2012 while leading a tour group to a North Korea economic zone.
Mr Fowle had been detained after leaving a Bible in a nightclub in the hope that it would reach the country's underground Christian community.
The announcement about Mr Bae and Mr Miller came one day before US president Barack Obama travels to Asia for a three-country visit.
The development does not mean a change in US posture regarding North Korea's disputed nuclear programme, and the North must still show it is serious and ready to abide by commitments towards de-nuclearisation and improved human rights, said a senior Obama administration official.
The official said there was no quid pro quo involved in the Americans' release.
The US notified allies of Mr Clapper's trip to North Korea and alerted members of the congressional leadership once his visit was under way, the official said.
Mr Obama said he was "very grateful" for their release, adding that it was "a wonderful day" for Mr Bae and Mr Miller and their families.
The president also praised Director of National Intelligence James Clapper, who travelled to North Korea to take the Americans home.