North Korea has released detained US citizens Kenneth Bae and Matthew Todd Miller, and they are already on their way home.

The release of the prisoners was confirmed by Office of the Director of National Intelligence, which said that the Bae and Miller were being accompanied to the US by James Clapper, the director of national intelligence.

The US State Department said that it “welcomed” the release of Bae and Todd by the hard-line Stalinist regime in Pyongyang.

“We are grateful to director of national intelligence [James] Clapper, who engaged on behalf of the US in discussions with DPRK (Democratic People's Republic of Korea) authorities about the release of two citizens,” the State Department said in a statement.

“The Department of State welcomes the release of US citizens Kenneth Bae and Matthew Todd Miller from the DPRK (Democratic People's Republic of Korea), where they have been held for two years and seven months, respectively," it said. "We also want to thank our international partners, especially our Protecting Power, the government of Sweden, for their tireless efforts to help secure the freedom of Mr Bae and Mr Miller.”

Barack Obama also said the US is “grateful” for the safe return of its citizens from North Korea, praising intelligence chief Clapper for “doing a great job on what was obviously a challenging mission."

"It's a wonderful day for them (Bar and Miller) and their families," the US President said.

Kenneth Bae’s son, Jonathan, said that it’s "awesome" that his father was released and that he "couldn't be happier."

Korean-American evangelical Christian missionary Kenneth Bae was handed a 15-year prison term in April 2013 on charges of planning to overthrow the North Korean government.

Matthew Todd Miller was sentenced to six years of hard labor on September 14 for committing "acts hostile to the DPRK while entering...under the guise of a tourist."

Todd Miller reportedly tore up his visa upon arriving in the country and demanded political asylum in communist North Korea. The incident took place on April 10. The court said that Miller had been planning to "experience prison life so that he could investigate the human rights situation."

Pyongyang claimed the results of its investigation showed that Miller did so “not because of simple lack of understanding, but deliberately perpetrated such criminal act for the purpose of directly going to prison.”

“He believed that people in the DPRK have neither freedom nor human rights and if they disobey the government they would be subject to a miserable prison life,” KCNA said back in September.

Thus, the court said, Miller had “a foolish idea” of spying on the prison and human rights situation in the country.

“It was his calculation that when he kicked up a fuss tearing up his tourist visa, while going through formalities for entry as a tourist, he would be arrested by a relevant organ and taken to ‘prison’. So, he applied for a tour through a travel agency in the US.”

READ MORE:Wanted to be ‘second Snowden’: N. Korea accuses jailed US citizen of ‘spying ambition’

Bae and Miller were the last American citizens held by North Korea after it released Jeffrey Fowle in October. Fowle spent nearly half a year in detention after being accused of leaving a Bible in a nightclub bathroom.