Haynes is "returning to private life" in March, the Defense Department said in a news release Monday.
Defense Secretary Robert Gates said Haynes has served the department "and the nation with distinction."
"I have valued his legal advice and enjoyed working with him," said Gates.
Haynes thanked Gates and President George Bush "for their confidence and for the opportunity to serve."
The Pentagon announced Feb. 11 it was charging six Guantanamo detainees -- including alleged Sept. 11 mastermind Khalid Sheikh Mohammed -- with war crimes, and was seeking the death penalty in each case.
The former chief U.S. prosecutor for the military commissions suggested in a published report last week the upcoming detainee trials may be rigged. Retired Col. Morris Davis told TheNation.com that Haynes told him there could not be any acquittals.
Davis resigned from the U.S. Air Force last year, claiming the Pentagon was meddling in the commission process and alleging a conflict of interest in Haynes' role.
Daniel J. Dell'Orto, principal deputy general counsel of the Defense Department since June 2000, will be acting general counsel, the Pentagon said.