President Barack Obama told Brian Williams on Friday that he would authorize swapping five Taliban militants for Sgt. Bowe Bergdahl again — even after an outcry over the soldier’s conduct, criticism of the deal and an uproar over why Congress was kept in the dark.

In an exclusive interview for “NBC Nightly News” from Normandy, France, where world leaders gathered to mark the 70th anniversary of D-Day, Obama said the Bergdahl decision came down to a simple principle.

“When somebody wears our country’s uniform and they’re in a war theater and they’re captured,” he said, “we’re gonna do everything we can to bring ’em home.”

The extended interview airs on “NBC Nightly News” and on “Brian Williams Reporting: Journey to Normandy,” which airs Friday at 8 p.m. ET on NBC.

The interview was Obama’s first since the Taliban returned Bergdahl to U.S. forces in exchange for five prisoners held at the American prison at Guantanamo Bay, Cuba.

Since then, Bergdahl’s platoon mates have accused him of desertion for walking away from his outpost in Afghanistan before he was captured in June 2009. Republicans in Congress have said the trade put American lives at risk because the five men could be called back to the fight. And members of Congress have suggested the president broke the law by not giving Congress 30 days’ notice before the operation.

The administration has argued that it had to move quickly because Bergdahl’s health was deteriorating rapidly.

“We had to act fast in a delicate situation that required no publicity,” Obama told Williams.

On criticism of the deal, the president pointed out that the war in Afghanistan is ending, and that, by definition, “you don’t do prisoner exchanges with your friends, you do ’em with your enemies.”

“It’s also important for us to recognize that the transition process of ending a war is gonna involve, on occasion, releasing folks who we may not trust but we can’t convict,” Obama said.

He concluded: “This is something that I would do again, and I will continue to do wherever I have an opportunity, if I have a member of our military who’s in captivity. We’re gonna try to get ’em out.”

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The exclusive interview covered a broad range of topics. Here are excerpts of what the president had to say.

Obama on Snowden

Edward Snowden, who leaked details of sprawling government spy programs, told Williams in an exclusive interview last week that the government could not point to anyone who had been hurt by the disclosures.

Obama said there are “patriots on both sides” of the debate, but he took issue with the idea that no harm had been done.

He said: “I will say that the disclosures that we’ve seen had a very significant impact on our intelligence operations around the world, had a grave impact on a number of our diplomatic relationships, compromised our ability to gain insight into some of the work that our adversaries do in probing and potentially finding weaknesses in our defenses.”

The president acknowledged that the capacity to collect data — not just by the government but by companies — has become “enormous.”

Still, he said, “In terms of how our intelligence services operate, it is much more constrained than, I think, both popular images that you see in movies and television would portray — or, frankly, how some of the commentators post-Snowden have, have described it.”

Obama on Putin

The D-Day gathering brought Obama face-to-face with Russian President Vladimir Putin for the first time since Putin’s forces took the Crimean peninsula from Ukraine. They spoke on the sidelines of a lunch for world leaders.

Before that meeting, Obama told Williams that Putin had violated international law by breaching the territorial integrity of Ukraine and was “actively undermining” eastern Ukraine, where pro-Russian separatists are fighting security forces.

Obama held out hope that the U.S.-Russian relationship can improve if “Russia begins to act in accordance with basic international principles.”

“There are areas where there has been great cooperation between the United States and Russia,” the president said. “We could not have executed some of the work that we’ve done to bring Iran to the table on nuclear weapons without Russia’s cooperation. They have helped us provide passage for equipment and supplies to our troops in Afghanistan.

“We’ve worked together on certain counterterrorism issues, and we have worked on nonproliferation issues together as well. But on this particular issue of Ukraine, we have a deep difference.”

Obama on his grandfather’s service

Obama’s maternal grandfather, the late Stanley Dunham, was a supply sergeant in the U.S. Army Air Forces in 1944. He and his maintenance company followed the Allied front across France. They crossed the English Channel six weeks after D-Day.

“It’s quite a distinction to be able to say that a family member fought in Patton’s Third Army,” Williams said.

Obama described his grandfather, who died in 1992, as “the first to be very humble about his service.”

“So many of us have in our families, you know, these men who were so young when they, when they came here and showed such extraordinary courage and capacity to — and changed the world, and then go back home and settle back down. And they didn’t really make a fuss about it,” he said.

Obama on a second D-Day

Williams asked Obama about a hypothetical second D-Day: “As commander-in-chief, do you roll over in your head the notion, God forbid the cause should arrive, could we do it again today, something this titanic, this massive, this all-in?”

Obama noted that it was important to do “the hard work of diplomacy” but said he was certain that the military would be up to the task.

“There are a lot of terrible things going on around the world,” he said. “but I have no doubt that if the, the freedom and liberty of not only ourselves, but our allies, were at stake, that our military would respond to my orders and would do as great of a job as the men who participated in the landing here.”