The Pakistan Army said on Thursday that it had recovered "safe and sound" a family of foreign hostages from the custody of a terrorist outfit after it received and acted on intelligence shared by the United States (US).

An Inter-Services Public Relations (ISPR) statement today said the hostages included a Canadian man, his American wife and their three children. The hostages were recovered "through an intelligence-based operation by Pakistani troops and intelligence agencies."

"They were captured by terrorists from Afghanistan in 2012 and kept as hostages there," the ISPR handout read.

"US intelligence agencies had been tracking them and shared their shifting across to Pakistan on October 11, 2017, through the Kurram Agency border," ISPR said.

The recovered hostages "are being repatriated to their country of origin."

Although the identities of the recovered hostages have not yet been revealed or confirmed by the army's media wing, they are believed to be Joshua Boyle and Caitlan Coleman, kidnapped in Afghanistan in 2012 while on a backpacking trip, and their three children — all of whom were born in captivity.

Caitlan Coleman (L), Joshua Boyle (C) and their two sons in a picture released in December 2016. ─ Reuters/File

Coleman, 31, was pregnant at the time of abduction. A video released by the Taliban last year had showed the family, including two young boys.

"The success [of the operation] underscores the importance of timely intelligence sharing and Pakistan's continued commitment towards fighting this menace [of terrorism] through cooperation between two forces against a common enemy," the ISPR handout said.