In August 2009, when Attorney General Eric H. Holder Jr. announced the inquiry, he said the Justice Department would not prosecute anyone for following the legal guidance given by the department’s Office of Legal Counsel, as a C.I.A. spokesman, George Little, pointed out.

Image Jay S. Bybee Credit... Evan Vucci/Associated Press

Mr. Holder assigned the investigation to John H. Durham, a veteran federal prosecutor in Connecticut who since 2008 had been reviewing the destruction by the C.I.A. of interrogation videotapes to see if any laws were broken. Mr. Durham has yet to produce any conclusions about either matter and his spokesman declined to comment on Thursday.

Judge Bybee ran the Office of Legal Counsel from late 2001 to 2003 — a time when it provided crucial advice about the treatment of detainees taken in the war against Al Qaeda and the Taliban. Much of that advice was written by a deputy, John Yoo, but Judge Bybee signed off on it.

Their legal memorandums were still secret when President George W. Bush appointed Judge Bybee to the federal appeals court in San Francisco. But in 2004, after the Abu Ghraib torture scandal, several of the memorandums were leaked to the news media.

The memorandums sparked intense controversy, and Judge Bybee’s successors in the Bush administration withdrew several of them. They were also heavily criticized by legal scholars, and some critics have called for Mr. Yoo to be fired from the University of California, Berkeley, where he is a tenured law professor, and for Judge Bybee to be impeached.

A five-year investigation by the Justice Department’s ethics office sharply criticized the memorandums and found, in a report disclosed this year, that the two men had committed “professional misconduct.” But that finding was rejected by David Margolis, a career lawyer at the Justice Department who made a final ruling on the ethics review. Mr. Margolis said the work of Judge Bybee and Mr. Yoo had “significant flaws,” but said that any assessment should consider the climate of fear and urgency after the Sept. 11, 2001, attacks.

Judge Bybee provided few new details about the construction of those memorandums in his testimony, and frequently said he could not recall conversations and meetings about them. He did say that when he briefed Attorney General John Ashcroft about the memorandums, “the attorney general said something to the effect that he was sorry that this was necessary.”