“The agency did none of this out of enthusiasm,” he said. “It did it out of duty, and it did it with the best legal advice it had.”

Image Eric H. Holder Jr., left, Barack Obamas choice for attorney general, shaking hands on Thursday with Senator Arlen Specter. Credit... Doug Mills/The New York Times

At his confirmation hearing, Mr. Holder struck a tough tone as well. He said that fighting terrorists would be his top priority, just as it had been for the Bush administration after the Sept. 11 attacks, and that there was no question “we are at war” with terrorists. But he also repudiated some of the key tactics the administration had used in the fight against terrorism, and he suggested that his Justice Department would place a higher premium on working with Congress and respecting civil liberties and due process.

Mr. Holder reaffirmed Mr. Obama’s promise that the American detention center at Guantánamo Bay would be closed, but acknowledged that it would “not be an easy task” because of uncertainties about what to do with some 250 prisoners remaining there.

He said that while some prisoners would most likely be repatriated to their native countries, he would seek to try others in criminal courts in the United States. The system of military commissions favored by the Bush administration, he said, does not guarantee enough due process rights for detainees. If the commissions are to be used at all, he said, they must be revamped to ensure “due process rights that I think are consistent with who we are as Americans.”

Mr. Holder said he would reject some broad claims to executive authority by the Bush administration, saying he did not believe a president had the clear power to act in defiance of a legitimate law. “No one is above the law,” he said repeatedly.

Mr. Holder described as “very useful” the secret program that President Bush authorized after the Sept. 11 attacks to allow wiretapping on terror suspects without a court order. But he also said that the administration should have gone to Congress for authorization from the outset rather than acting in apparent defiance of a 1978 law.

Mr. Holder also said he would work to restore morale and credibility at the Justice Department after internal reports that have found politicization in the hiring of department lawyers. He described as “deplorable” the actions of a former senior civil rights lawyer, Bradley Schlozman, who was found in a department report this week to have hired 63 lawyers with conservative credentials. Mr. Holder said he would re-examine the department’s refusal to bring criminal charges against Mr. Schlozman over accusations that he gave false statements to Congress on the issue.