Two American citizens detained by North Korean authorities have been released and are returning home, U.S. State Department officials announced Saturday.

Kenneth Bae, who was held in captivity for two years, and Matthew Todd Miller, who was detained for seven months, are being brought back to the U.S. by James Clapper, director of National Intelligence. They are the last Americans being held by North Korea, which has dealt harshly with foreigners over religious activity that is banned by the oppressive regime.

President Obama, speaking Saturday at an event to announce his nomination for attorney general, addressed the release of the Americans. “I think it’s a wonderful day for them and their families. Obviously we are very grateful for their safe return, and I appreciate Director Clapper doing a great job on what was obviously a challenging mission.”

“The safety and welfare of U.S. citizens abroad is the Department of State’s highest priority, and the United States has long called on DPRK authorities to release these individuals on humanitarian grounds,” State Department spokesperson Jen Psaki said in a statement Saturday. “We join their families and friends in welcoming them home.”

Bae, a 46-year-old missionary from Washington state, was first arrested in November 2012 and given a 15-year sentence for spreading religious material. Miller was sentenced in September to six years of hard labor for entering the country illegally and committing “hostile acts” against the country. The 24-year-old California native reportedly tore up his entrance visa and demanded asylum while at the Pyongyang airport in April.

“Words cannot adequately express our relief and gratitude that Kenneth is finally coming home! We have been waiting for and praying for this day for two years. This ordeal has been excruciating for the family, but we are filled with joy right now,” Bae’s family said in a statement Saturday afternoon.

Government officials of Sweden helped secure Bae and Miller’s return, Psaki said in the statement. “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.”

The release of the two men comes just weeks after another American, 56-year-old Jeffrey Fowle, was allowed to return home following nearly six months of imprisonment under the totalitarian regime. Fowle was arrested in April after being accused of leaving a Bible in a hotel.