President Donald Trump announced on Thursday that US and Pakistani officials had secured the release of an American woman, her Canadian husband and their three children from Taliban captivity.
The US leader identified the kidnapped couple as Caitlan Coleman and Joshua Boyle, and said their release was a "positive moment" for US relations with Pakistan.
"Ms Coleman gave birth to the couple's three children while they were in captivity," Trump said, in a White House statement. "Today, they are free."
Trump said that the family had been held hostage by the Haqqani network, "a terrorist organisation with ties to the Taliban."
Earlier, the Pakistani military had said that the hostages had been rescued in the Kurram district of the semi-autonomous tribal belt on Pakistan's Afghan border.
Boyle and Coleman were kidnapped by the Afghan Taliban during a 2012 backpacking trip to war-torn Afghanistan, and they appeared in a hostage video in December last year pleading for their release.
"This is a positive moment for our country's relationship with Pakistan. The Pakistani government's cooperation is a sign that it is honouring America's wishes for it to do more to provide security in the region," Trump 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."
Intelligence from US
Earlier, Pakistan's army said it had rescued the couple and their three children after receiving intelligence from the United States.
The rescue came as Pakistan and the United States, uneasy allies in fighting Taliban and other extremists in the region, are experiencing one of the worst lows in relations.
"We welcome media reports that a family including US citizens has been released from captivity," a US Embassy spokesman said on Thursday evening, referring other questions to Washington.
Pakistan touted the success of the operation as proof of the strength of the alliance.
"The success underscores the importance of timely intelligence sharing and Pakistan's continued commitment towards fighting this menace through cooperation between two forces against a common enemy," the Pakistani army statement said. The family were released from "terrorist custody".
US intelligence agencies had been tracking the hostages and on Wednesday shared that the family had been moved across to Pakistan through Kurram tribal area border, the army said. No other details were immediately available.