President Obama on Tuesday strongly defended his administration’s decision to return five detainees held at Guantanamo Bay to the Taliban in exchange for the release of Army Sgt. Bowe Bergdahl after five years of captivity, though he acknowledged that some of the released detainees could once again try to harm the United States.

“We have consulted with Congress for quite some time about the possibility that we might need to execute a prisoner exchange in order to recover Bergdahl,” Obama said on a trip to Poland to discuss Eastern European security. “We saw an opportunity, and we were concerned about Bergdahl’s health. We had the cooperation of the Qataris to execute an exchange, and we seized that opportunity.” He added that “the process was truncated because we wanted to make sure we would not miss that window.”

Amid mounting congressional criticism about the operation, senior military leaders also responded to criticism within the ranks toward Bergdahl, who walked off his base and away from his unit five years ago after becoming disillusioned with the war effort. In statements, both the chairman of the Joint Chiefs of Staff and Army Secretary John McHugh appeared to leave open the possibility that the young soldier could face a reprimand of some kind.

“Our first priority is ensuring Sgt. Bergdahl’s health and beginning his reintegration process,” McHugh said. “There is no timeline for this, and we will take as long as medically necessary to aid his recovery.”

The Army, he added, will “then review this in a comprehensive, coordinated effort that will include speaking with Sgt. Bergdhal to better learn from him the circumstances of his disappearance and captivity. All other decisions will be made thereafter, and in accordance with appropriate regulations, policies and practices.”

In exchange for the release of U.S. Army Sgt. Bowe Bergdahl, the U.S. agreed to free five Taliban commanders from the military detention center at Guantanamo Bay, Cuba. They were among the Taliban’s most influential commanders. (Tom LeGro and Natalie Jennings/The Washington Post)

Obama also refused to rule out that Bergdahl could face punishment for, as some allege, abandoning his unit in Afghanistan. But he said that question is not the priority as Bergdahl recovers from captivity.

“We obviously have not been interrogating Sgt. Bergdahl,” Obama said. “He’s going to have to undergo a significant transition back into life. He has not even met with his family yet.”

Obama added that regardless of the circumstances of his capture, “we still get back an American soldier if he’s held in captivity. Period. Full stop.”

Obama framed the war decisions he faced as the natural sorts of choices that come with the end of the war.

“It’s what happened to George Washington. It’s what happened to Lincoln. It’s what happened to FDR,” he said.

Bergdahl, 28, is believed to have slipped away from his platoon’s small outpost in Af­ghanistan’s Paktika province on June 30, 2009. He was captured shortly afterward by enemy ­forces and held captive in Pakistan by insurgents affiliated with the Taliban. Some U.S. troops resented risking their lives in the weeks that followed to search for someone they considered a deserter.

Since Bergdahl’s release, the administration has faced questions over its decision to free the five Guantanamo detainees and to not notify Congress 30 days in advance, as required by law. The administration has said it was forced to move quickly “due to a near-term opportunity to save Sgt. Bergdahl’s life.” It has also said it had flexibility given a signing statement from Obama last year in which he contended that the notification requirement was an unconstitutional infringement on his powers and that he therefore could override it.

On Tuesday, Caitlin Hayden, a spokeswoman for the National Security Council, said that delaying the swap would have interfered with the president’s obligation to “protecting the lives of Americans abroad and protecting U.S. soldiers.”

The outlines of the proposed Bergdahl swap had been public since the spring of 2012. Obama administration officials first discussed with senior House Republicans the possibility of swapping five detainees from the U.S. detention facility at Guantanamo Bay, Cuba, in exchange for the release of Bergdahl in late November 2011, according to senior GOP aides.

Still, House Speaker John A. Boehner said Tuesday in a statement that the administration “has invited serious questions into how this exchange went down and the calculations the White House and relevant agencies made in moving forward without consulting Congress despite assurance it would reengage with members on both sides of the aisle.”

House Armed Services Committee Chairman Howard P. “Buck” McKeon (R-Calif.) has said he will hold hearings on the matter, and Boehner said in his statement Tuesday that he supports that decision.

Sen. Dianne Feinstein (D-Calif.), chairwoman of the Senate Intelligence Committee, confirmed Tuesday that she and other senior lawmakers first discussed the possibility of a prisoner swap with administration officials in fall 2011.

During the consultations, “There were very strong views and they were virtually unanimous against the trade,” she said.

Despite the objections, “The White House is pretty unilateral about what they want to do when they want to do it,” Feinstein added later. “I think the notification to us is important and I think that it would have been a much better thing to do, because you do try to work together and you understand you’re not always going to agree with the executive.”

Feinstein said she received a phone call from White House Deputy National Security Adviser Tony Blinken on Monday evening, during which he apologized for not informing her of the plans sooner. “He apologized and said it was an oversight, so I just accept that,” Feinstein said.

Sen. Carl Levin (D-Mich.), chairman of the Senate Armed Services Committee, said that members of Congress “should not be surprised that [Obama] acted as he did in the circumstances that existed.”

He added, however, that he intends to ask Defense Secretary Chuck Hagel what risks the United States would have incurred if the administration had waited 30 days after finishing negotiations to complete the transfer of the Guantanamo detainees.

In Warsaw, Obama said both the United States and authorities in the Persian Gulf emirate of Qatar, who helped organize the trade, would closely monitor the released Guantanamo detainees.

“Is there the possibility of some of them trying to return to activities that are detrimental to us? Absolutely,” Obama said in a news conference with Poland’s president. “There’s a certain recidivism rate that takes place.”

But Obama added that he would not have authorized the trade if he “thought it was contrary to U.S. national security.”