An American woman, her Canadian husband, and their three children were freed from captivity on Wednesday after being held hostage by Taliban-linked for five years, officials announced.

Caitlan Coleman and her husband, Joshua Boyle, were taken captive in 2012 while traveling in a mountainous part of Afghanistan, near Kabul. The pair were held hostage by the Haqqani network, an organization with ties to the Taliban, in Afghanistan for much of the five years.

Coleman was pregnant at the time they were captured and gave birth to the couple’s three children while they were held.

The Coleman-Boyle family had appeared in multiple hostage videos over the years. In December of 2016, Coleman asked the US government to save them from their “Kafkaesque nightmare.”

But US authorities on Wednesday tracked the family being moved into Pakistan, where an operation was carried out by the local army to free them.

“The operation by Pakistani forces, based on actionable intelligence from US authorities was successful,” the Pakistani army said in a statement. “All hostages were recovered safe and sound and are being repatriated to the country of their origin.”

Chrystia Freeland, the Canadian Minister of Foreign Affairs, said she was “greatly relieved” by the family’s release. “We stand ready to support them as they begin their healing journey. We ask that the families’ privacy be respected,” her statement read.

President Trump said the release “is a positive moment for our country’s relationship with Pakistan.”

“The Pakistani government’s cooperation is a sign that it is honoring America’s wishes for it to do more to provide security in the region,” he said. “We hope to see this type of cooperation and teamwork in helping secure the release of remaining hostages and in our future joint counterterrorism operations.”

Secretary of State Rex Tillerson praised US Ambassador Hale and his team for their engagement with Pakistan in a statement and said “these efforts reflect the best of what America can accomplish.”

Tillerson said the president’s new strategy in South Asia recognizes the important role Pakistan needs to play to bring “stability and ultimately peace” to the region.

“The United States is hopeful that Pakistan’s actions will further a U.S.-Pakistan relationship marked by growing commitments to counterterrorism operations and stronger ties in all other respects,” he said in the statement.

Cora Lewis is a business reporter for BuzzFeed News and is based in New York. Lewis reports on labor.

Contact Cora Lewis at cora.lewis@buzzfeed.com.

Talal Ansari is a reporter for BuzzFeed News and is based in New York. His secure PGP fingerprint is 4FEE 894C 8088 7E08 E170 A515 2801 7CC6 95D3 11C2

Contact Talal Ansari at talal.ansari@buzzfeed.com.

Got a confidential tip? Submit it here.