WASHINGTON — Congress is moving to intervene in a legal dispute over whether female guards at the Guantánamo Bay prison should be barred from touching Muslim detainees, wading into a fight that has raised questions about the independence of the war court from outside influences.

The dispute centers on military commission orders in late 2014 and early 2015 that have temporarily required the military to use only male guards to touch defendants when taking them to court or to meetings with their lawyers, in line with the religious beliefs of those detainees.

Several senior Pentagon officials and lawmakers called those orders outrageous. But the issue seemed to be settled last month, when Col. James Pohl, the judge overseeing the death penalty case against five detainees accused of aiding the terrorist attacks of Sept. 11, 2001, ruled that the military could use female guards to move the detainees after all.

Still, saying he was obliged to ensure the independence of his court from unlawful influence “from any source,” Colonel Pohl said he would leave in place, for six more months, the ban that he had previously imposed. He said that delay would “deter such additional inappropriate comments and further ameliorate” any taint.