And I'm Audie Cornish. Sparks flew on Capitol Hill today over the prisoner swap that won the release of Army Sgt. Bowe Bergdahl. Defense Secretary Chuck Hagel testified about the deal and he was facing house members who are angry over being kept in the dark. The U.S. traded five high-ranking Taliban leaders for Bergdahl last month. He had been held captive in Afghanistan. Here's NPR's David Welna.

DAVID WELNA, BYLINE: With Defense Secretary Hagel seated before him at the witness table, House Armed Services Committee chairman Buck McKeon cast the Pentagon chief as the hapless subordinate to a president intent on emptying the prison at Guantanamo Bay, Cuba where the five freed Taliban leaders were held.

REPRESENTATIVE BUCK MCKEON: Mr. Secretary, I don't envy the position you've been put in. We understand the responsibility you bear for signing these transfer agreements. But we're also aware of the immense pressure the White House has put on you to transfer these detainees so they can claim victory for closing Gitmo.

WELNA: The darts aimed at Hagel and his boss were bipartisan. Top Democrat Adam Smith said the White House had ignored a law, saying Congress had to have a month's notice about any prisoner transfer from Guantanamo.

REPRESENTATIVE ADAM SMITH: There was no reason that that 30 days notice couldn't have been given to the leadership of Congress. We can, in fact, keep a secret or, I would say, we're no worse at it than the administration.

WELNA: Hagel, a former Republican senator himself, acknowledged Congress had been cut out of the deal.

SECRETARY CHUCK HAGEL: I recognize that the speed with which we moved in this case has caused great frustration, legitimate questions and concern. We could have done a better job. We could have done a better job of keeping you informed.

WELNA: But Hagel maintained the risk of word getting out about the swap outweighed any obligation to inform Congress ahead of time.

HAGEL: The exchange needed to take place quickly, efficiently and quietly. We believe this exchange was our last, best opportunity to free him.

WELNA: It was an extraordinary situation, Hagel said, but he added the prisoner swap had been done legally and in the nation's finest traditions.

HAGEL: America does not leave its soldiers behind. We made the right decision. And we did it for the right reasons - to bring home one of our own people.

WELNA: Ohio Republican Michael Turner was unswayed. The Obama Administration, he told Hagel, set a terrible precedent for the swap.

REPRESENTATIVE MICHAEL TURNER: How is it the United States could've been in negotiations with a Haqqani network, a listed terrorist organization, and it not conflict with our policy that we do not negotiate with terrorists?

HAGEL: We dealt directly with the government of Qatar.

TURNER: Oh, that's our footnote now. So now the new policy of this administration is we don't negotiate with terrorists directly.

WELNA: The Pentagon's top negotiator in the swap was its General Counsel, Stephen Preston. He, too, testified before the panel.

STEPHEN PRESTON: We don't see this as setting a particular precedent both because it does fall within that tradition of prisoner exchanges and there have been, in the past, occasions where the United States has dealt with non-state actors who were holding a servicemember in order to achieve their recovery.

WELNA: As an example, Preston cited an American helicopter pilot in Somalia who had been captured by warlords. But Republicans remain deeply skeptical. Jeff Miller of Florida pressed Hagel on why Army Sergeant Bowe Bergdahl was still at the Army hospital in Germany, where he was taken after being freed.

REPRESENTATIVE JEFF MILLER: You're trying to tell me that he's being held in Landstuhl, Germany because of his medical condition?

HAGEL: Congressman, I hope you're not implying anything other than that?

MILLER: I'm just asking the question, Mr. Secretary.

HAGEL: I'm going to give you an answer, too. I don't like the implication.

MILLER: Well, answer it. Answer it. Answer it.

HAGEL: He's being held there because our medical professionals don't believe he's ready until they believe he is ready.

REPRESENTATIVE JACKIE SPEIER: I really fear for his return to this country with the kind of rhetoric that is being spewed in this very room.

WELNA: Committee Chairman McKeon said today's hearing is just the beginning of what may be a lengthy investigation of the prisoner swap. David Welna, NPR News, Washington. Transcript provided by NPR, Copyright NPR.