Matthew Todd Miller and Kenneth Bae are now on their way home.
Director of National Intelligence James Clapper travelled to North Korea and is accompanying the men back, the US has confirmed.
A third US citizen, Jeffrey Fowle, was freed last month and no Americans are now being held in North Korea.
President Barack Obama said he was “grateful” for their safe return.
He said it was “a wonderful day” for the men and their families.
The US had accused North Korea of using its citizens as pawns in a diplomatic game. Pyongyang denies the accusations.
James Clapper travelled to North Korea for direct talks with the authorities.
Barack Obama said: “I appreciate the director doing a great job on what was obviously a challenging mission.”
The US department of state said in a statement that it “welcomes the release of US citizens Kenneth Bae and Matthew Todd Miller from the DPRK [North Korea], where they have been held for two years and seven months, respectively”.
It added: “The United States has long called on DPRK authorities to release these individuals on humanitarian grounds. We join their families and friends in welcoming them home.”
One US official told Associated Press news agency that nothing was offered in return for the releases.
The official said that the releases had not changed the US view of North Korea’s nuclear program and that the North should show a serious commitment to denuclearization and improved human rights.
The US thanked Sweden, which serves as the US protecting power in North Korea, for its efforts in the releases.
Matthew Todd Miller, 24, had been sentenced to six years’ hard labor in September for what North Korean state media described as “hostile acts”.
He had been in custody since April 10 when, according to North Korean sources, he destroyed his tourist visa and demanded asylum.
Kenneth Bae, 42, had been arrested in November 2012 as he entered the north-eastern port city of Rason, a special economic zone near North Korea’s border with China.
He has been described as both a tour operator and Christian missionary. North Korea said he used his tourism business to form groups to overthrow the government.
Kenneth Bae was sentenced to 15 years’ hard labor in May 2013.
DYfPrbnse6oAt least 158 people have died in Spain's worst flooding disaster in generations. On October…
Google has been fined two undecillion (a two followed by 36 zeroes) roubles by a…
Embarking on a home remodel is an exciting journey, promising enhanced comfort, increased property value,…
The US presidential candidates continued to campaign across key swing states on October 20. Footage…
Elon Musk has said he will give away $1 million a day to a registered…
India and Canada have decided to expel their top envoys along with other diplomats as…