White House chief of staff John Kelly praised government officials in Pakistan on Thursday for working with the U.S. to rescue a family that had been held by the Taliban since 2012.

"Hopefully, there will be a change in the cooperative relationship between the United States and Pakistan, but the good news is the Pakistan officials got custody of the American citizens ... took them into custody, [and] held them for us," Kelly told reporters during a rare briefing on Thursday.

The couple, Caitlan Coleman and Joshua Boyle, had been captured by extremists during a backpacking trip to Afghanistan five years ago. Coleman gave birth to three children while being held in captivity, and the couple is thought to have suffered severe psychological trauma.

The White House announced Thursday that the U.S. and Pakistan had "secured the release of the Boyle-Coleman family" during a raid on Wednesday.

"They had been essentially living in a hole for five years," Kelly said. "I mean, that's the kind of people we're dealing with over there."

"Luckily, and thank God, the Pakistani officials have took them into custody from the forces of evil in that part of the world," he added, noting that the Trump administration had arranged for the family to return immediately to the U.S. or Canada, and "for medical treatment along the way."