(Reuters) - Defense Secretary Chuck Hagel told a contentious congressional hearing on Wednesday the exchange of five Taliban leaders for war prisoner Bowe Bergdahl was an imperfect decision that eroded trust with Congress but he denied it involved negotiating with terrorists.

Hagel told the House Armed Services Committee that President Barack Obama's approval of the prisoner exchange was the correct decision because it kept faith with the military's pledge not to leave troops behind. But he admitted "trust has been broken" by the failure to keep Congress adequately informed about the deal.

Lawmakers have criticized the administration for sending the five Taliban leaders held at Guantanamo prison to Qatar without giving them 30 days notice as required by law. They also have said the deal amounted to negotiating with terrorists.

"Bergdahl was a detained combatant being held by an enemy force, and not a hostage," Hagel said.

Angry Republican lawmakers reacted skeptically to Hagel's explanation of the administration's actions, accusing him of not trusting Congress. One questioned the military's rationale for holding Bergdahl at a U.S. military hospital in Germany since his release on May 31 from Afghanistan.

"You're trying to tell me that he's being held in Landstuhl, Germany, because of his medical condition?" Representative Jeff Miller asked.

"I hope you're not implying anything other than that," Hagel replied, noting Bergdahl was receiving both physical and psychological treatment after five years as a prisoner of the Taliban. "I don't like the implication of the question."

The initial euphoria over 28-year-old Bergdahl's release swiftly ebbed, with some of his former comrades accusing him of deserting his post in 2009 before his capture.

Hagel said he had been "offended and disappointed" by some of the treatment of Bergdahl's family. He said a comprehensive Army review would look at the legal issues surrounding Bergdahl's disappearance and capture. "His conduct will be judged on facts, not hearsay, posturing, charges or innuendo," Hagel said.

Hagel said the Obama administration felt a growing sense of urgency about freeing Bergdahl in the weeks leading up to the swap because of fears his health was deteriorating and warnings from Qatari intermediaries that "time was not on our side."

"We grew increasingly concerned that any delay, or any leaks, could derail the deal and further endanger Sergeant Bergdahl," Hagel said. "We were told by Qataris that a leak would end the negotiations for Bergdahl's release."

Efforts to secure Bergdahl's freedom began to quicken in January after the administration received a "proof of life" video from the Taliban through the Qatari intermediaries.

"It was disturbing," Hagel said. "It showed a deterioration in his physical appearance and mental state."

Feeling a greater sense of urgency because of the video and a break-off in indirect talks, the administration negotiated a memorandum of understanding in early May with Qatar detailing the security measures that would be enforced if any Taliban detainees were transferred to their custody, he said.

After the memo was signed, U.S. officials received a warning from Qatari intermediaries that "time was not on our side," Hagel said. They moved forward with indirect talks on the mechanism for the prisoner swap, reaching a deal on May 27.

"We were told by the Qataris that a leak would end the negotiations for Bergdahl's release," Hagel said.

The U.S. defense chief said the swap was set in motion just four days later. He said U.S. forces did not know the general area of the handoff until 24 hours beforehand and did not have the precise location until one hour before the swap.