Barring female guards from handling inmates at the US detention facility at Guantanamo Bay poses a “risk” to the soldiers working there, the commander of a top-secret prison unit said.

The commander was testifying at a hearing over a discrimination complaint brought by several women deployed to the remote US base in southeastern Cuba.

The issue flared in November, when military judge Kirk Waits granted an emergency order to temporarily halt the use of female guards in handling detainee Abd al-Hadi al-Iraqi.

Lawyers for Iraqi — who faces life in prison on war crimes charges stemming from attacks against US personnel in Afghanistan — have argued that Islam forbids such contact between a man and a woman who is neither his wife nor a relative.

“I’m a devoted Muslim… I believe it’s a sin,” Iraqi said in a written statement read to the military tribunal at Guantanamo, which was monitored by reporters from Fort Meade, outside Washington.

The Obama administration — which has redoubled its efforts in recent months to shut the controversial prison — has asked the tribunal to lift the ban without delay, given the “practical difficulties and far-reaching consequences.”

The commander of Camp 7, whose identity was not revealed for security reasons, said it would be “extremely difficult” to ensure detainee transfers to meet their attorneys and attend hearings without female guards.

“Removing a trained female escort… it is a risk for my soldiers,” said the Army officer, adding he had never been confronted with a “gender-specific order” in 16 years in the military.

One female guard testified she had “never had a problem based on my sex,” even when in direct contact with men in Iraq and Afghanistan.

But Iraqi’s lawyer Lieutenant Colonel Tom Jasper insisted on the “cultural and religious differences” at issue, and that “no offense” should be taken by the female guards.

The hearing was to continue Thursday. The timing of a ruling was not immediately clear.