Catalina Camia

USA TODAY

WASHINGTON — President Obama on Friday expanded his defense of the deal that led to the freedom of Army Sgt. Bowe Bergdahl, saying in an NBC News interview that the release of five Taliban detainees was partly a consequence of winding down the war in Afghanistan.

"You don't do prisoner exchanges with your friends, you do 'em with your enemies," Obama told NBC's Brian Williams. "It's also important for us to recognize that the transition process of ending a war is going to involve, on occasion, releasing folks who we may not trust but we can't convict."

He repeated his desire to "whittle away" at the number of detainees at Guantanamo Bay, Cuba. "By definition ... we are ending a war," Obama said. "Then there's going to be a process in which some of those individuals are going to be released."

The deal that won the release of Bergdahl after five years in captivity in exchange for five high-level Taliban detainees held at Guantanamo has sparked bipartisan outcry from Congress.

Even some of Obama's staunchest Democratic allies, such as Senate Intelligence Chairwoman Dianne Feinstein, D-Calif., voiced frustration at not being notified in advance about the exchange before the president appeared in the White House Rose Garden last Saturday with Bergdahl's parents.

In the NBC interview — taped while Obama was in Normandy, France to commemorate the 70th anniversary of the D-Day invasion — the president again explained his rationale for winning Bergdahl's release. Concerns have been raised that Bergdahl left his post before he was subsequently captured by the Taliban in 2009.

"We have a rule, a principle, that when somebody wears our country's uniform and they're in a war theater and they're captured ... we're going to do everything we can to bring 'em home," Obama said. "Bowe Bergdahl was one of those individuals. And regardless of whatever circumstances there are, it is our obligation to bring them home."

In the interview, Obama also discussed the impact of Edward Snowden's leaks of classified information and the sacrifices of World War II veterans, including his own grandfather and uncle.

On Snowden, the former National Security Agency contractor, Obama explained that the disclosures that have become public "had a very significant impact on our intelligence operations around the world" and a "grave impact" on diplomatic relationships. He said Snowden's leaks "compromised our ability to gain insight into some of the work that our adversaries do in probing and potentially finding weaknesses in our defenses."

Asked if the United States could again lead such a dramatic invasion as the one on the beaches of Normandy 70 years ago, Obama said "our military would be up to the task." But it's not an order he'd like to give.

"My job as commander in chief is to make sure that...we are avoiding such choices by doing the hard work of diplomacy, by rallying our allies, by trying to blunt aggression before it gets outta hand," he said.