Pentagon chief Chuck Hagel staunchly defended on Wednesday the swap of five Taliban detainees for a US soldier as a "tough" but necessary move to secure Sergeant Bowe Bergdahl's release.
Facing a barrage of criticism from lawmakers, Hagel said the exchange with the Taliban was part of the "brutal, imperfect realities" that come with war and that the deal brokered by Qatar represented the "last, best opportunity" to ensure the soldier's freedom.
"We made the right decision, and we did it for the right reasons -- to bring home one of our own people," a defiant Hagel told the House Armed Services Committee.
Hagel, the first administration official to testify publicly about the swap, said Obama faced a "tough call" but made the right choice despite the risks.
Invoking his own service as an army sergeant in Vietnam, Hagel said wars were "messy" and presented "imperfect choices."
"War is a dirty business. And we don't like to deal with those realities, but realities they are," he said.
Hagel described a dramatic chain of events leading up to Bergdahl's release, with US officials worried about Taliban militants staging an attack on special operations forces receiving the American soldier.
After signing a memorandum with Qatar on May 12 on the details of the transfer of the Taliban detainees, the Qataris issued a warning to US officials that "time was not on our side," Hagel said.
"This indicated that the risks to Sergeant Bergdahl's safety were growing."
Up to one hour before the release, the United States did not know the precise location where Bergdahl would be handed over to US special operations forces.
The May 31 exchange was in keeping with past US conflicts and there was no prospect of prosecuting the Taliban detainees held at the US prison in Guantanamo Bay, Cuba, Hagel said.
But Republicans at the hearing hammered away at Hagel, often interrupting him, accusing the White House of making concessions to "terrorists" and violating its legal obligation to consult with Congress.
"This transfer sets a dangerous precedent in negotiating with terrorists," said Buck McKeon, chairman of the House Armed Services Committee.
"It reverses longstanding US policy and could incentivize other terrorist organizations, including Al-Qaeda, to increase their use of kidnappings of US personnel."
The exchange for Bergdahl has turned into a growing political problem for the White House.
A new ABC News/Washington Post poll showed a majority of Americans opposed the deal, with 53 percent saying they disapproved. If Bergdahl is shown to have deserted, then 63 percent rejected the swap.
McKeon and others charged the Obama administration had failed to abide by a law requiring 30 days' notice to lawmakers before detainees are transferred out of the Guantanamo prison.
In a testy exchange with raised voices, Texas Republican Mike Conaway told Hagel: "Your actions say you don't trust Congress."
Hagel, a former Republican senator from Nebraska who broke ranks with his party over the Iraq war, fired back: "I never said I don't trust Congress."
Some Democrats also criticized the White House for not keeping lawmakers abreast of the situation, and Hagel acknowledged that the administration may have fallen short on that count.
"We could have done a better job of keeping you informed," said Hagel.
But Hagel added it was an "extraordinary situation" that could have collapsed if word had leaked of the plan.
The administration had "a fleeting opportunity" and there were few options available, he said.
"Every part of war-like prisoner exchanges, is not some abstraction or theoretical exercise," the Pentagon chief added. "All of these decisions are part of the brutal, imperfect realities we all deal with in war."
Before Bergdahl joined the army, he served in the US Coast Guard in 2006 but was discharged within days because he could not adapt to military life, a US defense official said on condition of anonymity.
Bergdahl's friends were surprised and dismayed when they learned he had signed up for the army two years after his abbreviated 26-day stint in the Coast Guard, according to The Washington Post.
The soldier went missing in 2009 during his deployment with US troops in eastern Afghanistan and was held by insurgents for nearly five years.
His disappearance has prompted speculation he may have deserted his post and the military has said it will investigate the case.