Pakistani soldiers have freed a North American family of five who were being held hostage by the Afghan Taliban.
Canadian Joshua Boyle and his US wife Caitlan Coleman were kidnapped while backpacking in Afghanistan in 2012. They had three children while in captivity.
They were rescued after a US tip-off during an operation near the Afghan border, the Pakistani army said.
US President Donald Trump said it was a "positive moment" for US-Pakistan ties.
"Ms Coleman gave birth to the couple's three children while they were in captivity," Mr Trump said in a White House statement. "Today, they are free."
He added: "The Pakistani government's co-operation is a sign that it is honouring America's wishes for it to do more to provide security in the region."
The Pakistani army said US intelligence agencies had been tracking the family in Afghanistan, and reported that on 11 October they had moved across the border into the Kurram tribal district of Pakistan.
In a statement it said: "The success underscores the importance of timely intelligence sharing and Pakistan's continued commitment towards fighting this menace through co-operation between two forces against a common enemy."
Canada's Foreign Affairs Minister Chrystia Freeland said her government was "greatly relieved" the family had been released and was safe, and thanked the US, Afghanistan and Pakistan.
"Joshua, Caitlan, their children and the Boyle and Coleman families have endured a horrible ordeal over the past five years. We stand ready to support them as they begin their healing journey," she added.
Videos of the couple have been released by the Taliban-aligned Haqqani network during their captivity. The insurgent group has been demanding the release of three of its prisoners in Afghanistan.
The latest video, released last December, showed the couple with two young boys. In it, Ms Coleman - who was pregnant when she and Mr Boyle were abducted - begged for an end to what she called their "Kafkaesque nightmare".
'They need one another'
By Gary O'Donoghue, BBC Washington correspondent
Relations between Washington and Islamabad have been fraught for years.
The US believes that Pakistan allows groups such as the Haqqani network to shelter within its borders, and that Pakistan's intelligence services have close links to the Taliban and other hostile groups inside Afghanistan.
In August, President Trump said: "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."
For its part, Pakistan accuses the US of failing to understand the sacrifices it has made in terms of lives through terrorist attacks on its soil.
Nevertheless, both sides need one another and so some kind of transactional relationship remains important.
Mr Trump went out of his way to thank Pakistan for its role in the rescue of the family, drawing a direct connection between his approach and the happy outcome.
But Washington will want to see further evidence over time that Pakistan is willing to continue co-operating before anything like real trust can exist between the two countries.