When he stepped down as attorney general in September after widespread criticism of the firing of federal prosecutors and withering attacks on his credibility, Mr. Gonzales talked proudly in a farewell speech of how his department was “a place of inspiration” that had balanced the necessary flexibility to conduct the war on terrorism with the need to uphold the law.

Associates at the Justice Department said Mr. Gonzales seldom resisted pressure from Vice President Dick Cheney and David S. Addington, Mr. Cheney’s counsel, to endorse policies that they saw as effective in safeguarding Americans, even though the practices brought the condemnation of other governments, human rights groups and Democrats in Congress. Critics say Mr. Gonzales turned his agency into an arm of the Bush White House, undermining the department’s independence.

The interrogation opinions were signed by Steven G. Bradbury, who since 2005 has headed the elite Office of Legal Counsel at the Justice Department. He has become a frequent public defender of the National Security Agency’s domestic surveillance program and detention policies at Congressional hearings and press briefings, a role that some legal scholars say is at odds with the office’s tradition of avoiding political advocacy.

Mr. Bradbury defended the work of his office as the government’s most authoritative interpreter of the law. “In my experience, the White House has not told me how an opinion should come out,” he said in an interview. “The White House has accepted and respected our opinions, even when they didn’t like the advice being given.”

The debate over how terrorist suspects should be held and questioned began shortly after the Sept. 11, 2001, attacks, when the Bush administration adopted secret detention and coercive interrogation, both practices the United States had previously denounced when used by other countries. It adopted the new measures without public debate or Congressional vote, choosing to rely instead on the confidential legal advice of a handful of appointees.

The policies set off bruising internal battles, pitting administration moderates against hard-liners, military lawyers against Pentagon chiefs and, most surprising, a handful of conservative lawyers at the Justice Department against the White House in the stunning mutiny of 2004. But under Mr. Gonzales and Mr. Bradbury, the Justice Department was wrenched back into line with the White House.

After the Supreme Court ruled in 2006 that the Geneva Conventions applied to prisoners who belonged to Al Qaeda, President Bush for the first time acknowledged the C.I.A.’s secret jails and ordered their inmates moved to Guantánamo Bay, Cuba. The C.I.A. halted its use of waterboarding, or pouring water over a bound prisoner’s cloth-covered face to induce fear of suffocation.