The Defense Department's longest-serving general counsel, who has been criticized for his role in crafting Bush administration policies for detaining and trying suspected terrorists, is resigning to return to private life next month, the Pentagon said Monday.

William J. Haynes II was confirmed as general counsel by the Senate in May 2001.

"I am sorry to see Jim leave the Pentagon," Defense Secretary Robert Gates said in a statement. "I have valued his legal advice and enjoyed working with him."

Daniel J. Dell'Orto, the Defense Department's principal deputy general counsel since June 2000, will serve as acting general counsel, the Pentagon said.

In 2006, President Bush nominated Haynes for a seat on the 4th U.S. Circuit Court of Appeals, based in Richmond, Va. The nomination was withdrawn in January 2007 when it appeared that the Senate's new Democratic majority would not confirm Haynes.

A group of retired military officers opposing Bush's position on the treatment of detainees had urged lawmakers to block Haynes' appointment to the court. They contended that his role in establishing detention and interrogation policies led to abuses at the detention facility at the U.S. naval base at Guantanamo Bay, Cuba, and called into question the military's commitment to the rule of law.

Within months of the terrorist attacks of Sept. 11, 2001, Haynes led a tour of military attorneys to Guantanamo as he worked on plans for military tribunals for prisoners captured in the war in Afghanistan. At the time a Pentagon spokeswoman referred to "charting completely new territory" in deciding how to deal with detainees.

Haynes' replacement, Dell'Orto, has defended the military tribunal system in appearances before Congress, saying the rules governing the tribunals "afford all the judicial guarantees which are recognized as indispensable by civilized people."

In response to allegations that the Bush administration had authorized torture against some prisoners, the White House released in 2004 a series of documents. In a Pentagon memo, dated Nov. 27, 2002, Haynes recommended that then-Defense Secretary Donald H. Rumsfeld approve the use of 14 interrogation techniques on detainees at Guantanamo, such as yelling at a prisoner during questioning and using "stress positions," like standing, for up to four hours.

In a handwritten note, Rumsfeld responded: "However, I stand for 8-10 hours a day. Why is standing limited to 4 hours." He later rescinded his approval and ordered a review of issues relating to interrogations of terrorism suspects.

Air Force Col. Morris Davis, the former chief military prosecutor at Guantanamo, who now heads the Air Force judiciary, welcomed Haynes' departure.

"I hope it will open the door for some positive change in the military commissions, but there are a couple of others still standing in the way," said Davis, who resigned as lead prosecutor of the Guantanamo detainees in October over alleged political interference in the U.S. military tribunals. "At least the odds are very good that whoever takes his place will have a more collegial and less contemptuous relationship with the uniformed judge advocates."

Davis last week said he would be a defense witness for Salim Ahmed Hamdan, the driver of terror leader Osama bin Laden. Davis called it "an opportunity to tell the truth."

At Hamdan's April pretrial hearing at Guantanamo, his defense team plans to argue that alleged political interference cited by Davis violates the Military Commissions Act, Hamdan's military lawyer, Navy Lt. Brian Mizer, has said.