The family was freed after an operation in Pakistan's Kurram tribal district along the Afghan border

Washington (AFP) - An American woman, her Canadian husband and three children born while the couple was held by the Taliban were released Thursday after a Pakistani operation.

US President Donald Trump hailed the couple’s freedom after five years held in the lawless Afghan-Pakistan border region by the notorious Haqqani network.

And he suggested that the rescue was the result of his tougher diplomatic stance against Pakistan, which Washington has been pressuring over its support for some armed Islamist groups.

“The Pakistani government’s cooperation is a sign that it is honoring America’s wish that it do more to provide security in the region,” Trump told reporters.

“They worked very hard on this, and I believe they’re starting to respect the United States again,” he said.

“I think right now a lot of countries are starting to respect the United States of America once again.”

Caitlan Coleman and Joshua Boyle were kidnapped during a backpacking trip in Afghanistan in 2012 and were held for five years, during which time they had three children.

A US military official said American forces were not involved in any rescue, but that a medical team had been able to meet the family and stood ready to fly them home if needed.

Trump identified their captors as the Haqqani group, whose head, Sirajuddin Haqqani, is also the Afghan Taliban’s deputy leader.

This faction has long been suspected of having links with Pakistan’s shadowy military establishment.

In 2011, the chairman of the US Joint Chiefs of Staff at the time, admiral Mike Mullen, described the Haqqani as a “veritable arm” of Pakistani intelligence.

Pakistan has been under increased pressure from Washington to crack down on alleged militant sanctuaries inside its borders after Trump lambasted the country in a televised address in August.

- High-profile attacks -

During the speech, Trump accused Islamabad of sheltering “agents of chaos” and suggested ties with Pakistan would be adjusted immediately but offered few details.

US Defense Secretary Jim Mattis and Secretary of State Rex Tillerson are due in Pakistan on separate visits later this month to maintain pressure on a country that was a Cold War US ally.

The Haqqani network has been accused of masterminding several high-profile terrorist attacks in the Afghan capital, including a massive truck bomb on May 31 that killed some 150 people.

They have been known to kidnap Western hostages and smuggle them across the Afghan border into Pakistan, as appears to have been the case with Coleman and Boyle.

The Pakistani military said the hostages had been “recovered… from terrorist custody through an intelligence-based operation by Pakistani troops.”

They were found in Kurram district, part of Pakistan’s semi-autonomous tribal belt, where militants such as the Haqqanis operated with impunity until the army intensified an operation there in 2014.

“US intelligence agencies had been tracking them and shared their shifting across to Pakistan on 11 Oct 2017 through Kurram Agency border,” the Pakistani military said.

Kurram borders Nangarhar and Paktia provinces in Afghanistan. Both are riven by militancy, with the Islamic State group gaining a foothold in Nangarhar and Paktia seen as a Haqqani stronghold.

The military said the five hostages were “safe and sound and are being repatriated to the country of their origin.”

It gave no further details about the circumstances surrounding the hostages’ recovery.

The head of US forces in the region, CENTCOM chief General Joseph Votel, said Pakistan recognizes how seriously the United States takes the safety of its citizens.

“They acted quickly and very responsibly to take control of these persons and again to effect their return,” he told reporters at CENTCOM headquarters in Tampa, Florida.

“So I view it very very positively. We are very grateful for it. I had an opportunity to talk with the the chief of army staff yesterday and I expressed my appreciation.”

- ‘Deep gratitude’ -

Boyle and Coleman appeared in a hostage video in December last year with two of their children pleading for their release.

The video was released after rumors swirled in Kabul that the government was planning to execute Anas Haqqani, son of the Haqqani network’s founder, who has been held since 2014.

Canada’s foreign affairs minister, Chrystia Freeland, expressed relief at the release.

“Joshua, Caitlan, their children and the Boyle and Coleman families have endured a horrible ordeal over the past five years,” she said in a statement.

Afghanistan is rife with militants and organized criminal gangs who stage kidnappings for ransom, targeting wealthy Afghans and foreigners, who have been ferried over the border.

The Taliban are also thought to be holding American Kevin King and Australian Timothy Weekes, professors at the American University of Afghanistan who were dragged from vehicles in Kabul by gunmen.

They most recently appeared in a hostage video released in June this year.