General Hartmann, whose title is legal adviser, has been at the center of a bitter dispute involving the former chief Guantánamo military prosecutor, Col. Morris D. Davis of the Air Force.

Colonel Davis has said the general interfered in the work of the military prosecution office, pushed for closed-door proceedings and pressed to rely on evidence obtained through techniques that critics call torture.

“National attention focused on this dispute has seriously called into question the legal adviser’s ability to continue to perform his duties in a neutral and objective manner,” the judge wrote on Friday, in a copy of the decision not released publicly but obtained by The New York Times. Decisions by Guantánamo judges are not typically released publicly until days after being handed down.

Cmdr. Jeffrey D. Gordon of the Navy, a Pentagon spokesman, declined to comment on the ruling, saying senior Defense Department officials were reviewing it.

Reached at his office shortly after the decision was distributed inside the Pentagon, General Hartmann said he could not talk. His spokeswoman did not respond to requests for comment.

Newsletter Sign Up Continue reading the main story Please verify you're not a robot by clicking the box. Invalid email address. Please re-enter. You must select a newsletter to subscribe to. Sign Up You will receive emails containing news content , updates and promotions from The New York Times. You may opt-out at any time. You agree to receive occasional updates and special offers for The New York Times's products and services. Thank you for subscribing. An error has occurred. Please try again later. View all New York Times newsletters.

General Hartmann, who has been a controversial figure since his appointment last summer, is the legal adviser to the Pentagon official with broad powers over the war crimes system, Susan J. Crawford. She has the military title of Convening Authority of the Guantánamo war crimes cases.

Ms. Crawford has never made a public statement in her role.

General Hartmann has been the military official most publicly identified with prosecutions in recent months. It was he, for example, who announced the Sept. 11 charges and has publicly pressed prosecutors to move faster.

Ruling on a defense lawyers’ request that said General Hartmann had exerted unlawful influence over the prosecution, Judge Allred said that public concern about the fairness of the cases was “deeply disturbing” and that he could not find that the general “retains the required independence from the prosecution.”

Advertisement Continue reading the main story

Pentagon officials could ask the judge to reconsider, could appeal to a special military appeals court created to hear Guantánamo cases or could replace General Hartmann.

General Hartmann has denied Colonel Davis’s assertions and said the commission system would “follow the rule of law.” He has also said he has pressed prosecutors and others involved in the tribunals to move the cases more quickly.

As convening authority, Ms. Crawford has powers over the entire war crimes system, including the power to approve or reject charges, to reach plea deals and to provide financial resources to the prosecution and the defense.

Among officials in the war crimes system, General Hartmann was assumed to have been acting on her behalf. But the judge did not find there was evidence suggesting she should be removed even from the single case.

Judge Allred’s ruling followed a hearing in Guantánamo on April 28 at which Colonel Davis said General Hartmann pressured him in deciding what cases to prosecute and what evidence to use. The judge called the hearing after lawyers for a detainee, Salim Hamdan, said his charges were unlawfully influenced.