US defence secretary Chuck Hagel told Congress that last month's prisoner swap with the Taliban may have been the "last, best" chance to secure the release of Sergeant Bowe Bergdahl.
He said mediators had indicated that time was slipping away to get the only US soldier held captive in Afghanistan out safely.
Hagel, the first Obama administration official to testify publicly about the controversial deal, told the House Armed Services Committee that Qatari officials warned in the days before the exchange that "time was not on our side" and a leak would sabotage the deal.
The transfer of five detainees at the US prison in Guantanamo Bay, Cuba, to Qatar was legal and advanced national interests, he added.
Republicans and some Democrats have criticised the administration for not informing Congress in advance, with some accusing the president of breaking a law requiring 30-day notification of any Guantanamo prisoner release.
Other questions centre on whether Bergdahl deserted and whether the US gave up too much for his freedom. Administration officials have told Congress that four of the five Taliban officials will likely rejoin the fight.
"We could have done a better job of keeping you informed," Hagel told the panel. But he called the operation an "extraordinary situation" that combined time-sensitive concerns over Bergdahl's health and safety, last-minute arrangements over where to pick up the soldier and persistent fears the Taliban may have been negotiating in bad faith.
"We grew increasingly concerned that any delay, or any leaks, could derail the deal and further endanger Sgt. Bergdahl," Hagel said. "We were told by the Qataris that a leak would end the negotiations for Bergdahl's release. We also knew that he would be extremely vulnerable during any movement, and our military personnel conducting the handoff would be exposed to a possible ambush or other deadly scenarios in very dangerous territory."
But a series of classified briefings in the 11 days since the operation has failed to answer a growing list of questions on Capitol Hill.
Opening the hearing, Howard McKeon, the committee's Republican chairman, described the agreement with the Taliban as the "deeply troubling" result of "unprecedented negotiations with terrorists".
McKeon, who has launched a committee investigation, said the deal could fuel further kidnappings of American personnel. And he described White House explanations thus far about the potential national security implications as "misleading and oftentimes blatantly false".
Hagel called the former Taliban government officials "enemy belligerents" and said they had not been implicated in any attacks against the United States. He said Qatar, which has promised to keep the former Guantanamo detainees inside the country for a year, committed to sufficient security measures that led him to decide the risks were not too great.
He also added: "If any of these detainees ever try to rejoin the fight, they would be doing so at their own peril."
Hagel said Washington only engaged in "indirect negotiations". He said a logistical agreement was released on May 27, four days before the exchange, and only then did president Obama make a final decision to move forward. Officials learned the general area for the hand-off of Bergdahl a day in advance and received the precise location an hour ahead of time, he said.
Bergdahl had been held captive since 2009. The Taliban officials had been at Guantanamo for more than a decade.
Beyond McKeon's investigation, the House Appropriations Committee also showed its displeasure this week. In a bipartisan 33-13 vote, it added a provision to a 570 billion US dollar defence spending bill that barred money for the future transfer of Guantanamo detainee. It also withholds other funds from the Defence Department until Hagel assures lawmakers that notification rules will be respected.