ISLAMABAD -- An American woman, her Canadian husband and their three young children have been released after years held captive by a network with ties to the Taliban, President Trump announced Thursday.

Caitlan Coleman of Stewartstown, Pennsylvania, and her husband, Canadian Joshua Boyle, were abducted five years ago while traveling in Afghanistan and had been held by the Haqqani network in Pakistan. Coleman was pregnant when she was captured and the couple had three children while in captivity.

The U.S. sent a C-130 transport plane to Pakistan to get the family out of the country, but Boyle declined to board, a White House official tells CBS News. Boyle's family called him and tried to persuade him to board the plane but were unsuccessful.

In a statement, Mr. Trump said the U.S. secured the family's release on Wednesday.

Get Breaking News Delivered to Your Inbox

"Today they are free," Mr. Trump said. "This is a positive moment for our country's relationship with Pakistan." He called the Pakistanis' cooperation "a sign that it is honoring America's wishes for it to do more to provide security in the region."

In remarks before signing an executive order later in the morning, Mr. Trump praised Pakistan for its willingness to "do more to provide security in the region." He said the release suggests other "countries are starting to respect the United States of America once again."

A U.S. national security official, speaking to the Associated Press on condition of anonymity to discuss an ongoing operation, commended Pakistan for their critical assistance in securing the family's release -- and described the cooperation as an important step in the right direction for U.S.-Pakistani relations.

The U.S. has long criticized Pakistan for failing to aggressively go after the Haqqanis, who have been behind many attacks against U.S. and allied forces in Afghanistan.

In Pakistan, its military said in a statement that U.S. intelligence agencies had been tracking the hostages and discovered they had come into Pakistan on Oct. 11 through its tribal areas bordering Afghanistan.

"All hostages were recovered safe and sound and are being repatriated to the country of their origin," the military said.

The release, which came together rapidly Wednesday, comes nearly five years to the day since Coleman and Boyle lost touch with their families while traveling in a mountainous region near the Afghan capital, Kabul.

The couple set off in the summer 2012 for a journey that took them to Russia, the central Asian countries of Kazakhstan, Tajikistan and Kyrgyzstan, and then to Afghanistan. Coleman's parents last heard from their son-in-law on Oct. 8, 2012, from an internet cafe in what Boyle described as an "unsafe" part of Afghanistan.

In 2013, the couple appeared in two videos asking the U.S. government to free them from the Taliban.

Coleman's parents, Jim and Lyn Coleman, told the online Circa News service in July 2016 that they received a letter from their daughter in November 2015, in which she wrote that she'd given birth to a second child in captivity. It's unclear whether they knew she'd had a third.

In this June 4, 2014, file photo, mother's Linda Boyle, left and Lyn Coleman hold photo of their married children, Joshua Boyle and Caitlan Coleman, who were kidnapped by the Taliban in late 2012 in Stewartstown, Pa. AP

"I pray to hear from you again, to hear how everybody is doing," the letter said.

In that interview, Jim Coleman issued a plea to top Taliban commanders to be "kind and merciful" and let the couple go.

"As a man, father and now grandfather, I am asking you to show mercy and release my daughter, her husband, and our beautiful grandchildren," Jim Coleman said. "Please grant them an opportunity to continue their lives with us, and bring peace to their families."

The family was being held by the Haqqani network. U.S. officials call the group a terrorist organization and have targeted its leaders with drone strikes. But the group also operates like a criminal network. Unlike the Islamic State of Iraq and Syria, it does not typically execute Western hostages, preferring to ransom them for cash.

Mr. Trump has called on Pakistan to do more to tackle militant organizations that use its territory as a home base.

"We can no longer be silent about Pakistan's safe havens for terrorist organizations, the Taliban and other groups that pose a threat to the region and beyond," Mr. Trump said in a recent speech announcing his Afghanistan policy. He issued a stark warning: "We have been paying Pakistan billions and billions of dollars at the same time they are housing the very terrorists that we are fighting. But that will have to change, and that will change immediately."