The methods used by the US military to feed inmates in Guantánamo Bay against their will presents a long-term risk to their health, a federal court heard on Tuesday.

Steven Miles, a doctor and professor of medical ethics at the University of Minnesota, told a courtroom that lubricating the feeding tubes at Guantánamo, used on hunger-striking detainees, can cause a form of chronic inflammatory pneumonia, and questioned whether the force feeding was medically necessary.

The condition, resulting from olive oil reaching the lungs due to misplaced insertions, would be hard to detect by physicians for released or transferred detainees, as it might look on x-rays like tuberculosis or lung cancer, Miles testified, calling the olive oil lubrication “astonishing to me”.

“There’s simply no debate about this. All the medical literature I’ve found said the [lubrication] had to be water-soluble. One doesn’t have to make very many salads to know olive oil is not water soluble,” Miles said.

Miles testified during the second day of a court challenge to the force feedings brought by Syrian detainee Abu Wa’el Dhiab, who wants judge Gladys Kessler to compel the US military to administer the forced feedings less painfully and to ban guards from forcing detainees out of their cells for the practice. Dhiab, whose lawyers rested their case on Tuesday, contends that the forced feedings and cell extractions are not medically necessary but are instead punishment for hunger striking.

Dhiab’s case has provided the first courtroom airing of a controversial procedure adopted by the military at Guantánamo, and represents the first judicial intervention into how the facility’s detention operations are conducted since it was established in 2002.

Guantánamo Bay authorities, who had claimed the olive oil was used as a culturally sensitive material, no longer use it to lubricate the tubes inserted into a detainee’s stomach through the nose. Lawyers for Dhiab asserted in court on Tuesday that Guantánamo authorities made the change after Miles had filed a written declaration questioning the practice.

Medical personnel administering the forced feedings now use water-based lubricant, said Captain Tom Gresback, a spokesman for the detention facility, a change made “to eliminate risk, albeit minimal, for olive oil to get into the bronchial tree and lungs, thereby possibly causing illness”.

Gresback, disputing a point Miles made during testimony, said there is “no medical evidence which would indicate that any residual amount of a non-water based lubricant remains in the detainees’ lungs in the unlikely event any ever entered the bronchial tree.”

Gresback said he did not have an estimate of how many detainees received olive oil as a lubricant for the feeding tubes.

Dhiab, captured in 2002 and cleared for release in 2009, is over 6ft tall and weighs 152lbs, and has been hunger striking for years to protest his confinement without charge. Medical records introduced into court evidence showed that Guantánamo’s Joint Medical Group showed that Dhiab would sometimes have force-feeding sessions occur multiple times a day, something Miles said increased the risk of harm and infection to a patient – the government’s rationale for removing the tubes each feeding session.

Miles, who spoke laconically and without passion, recommended that the tubes remain in place for several weeks at a stretch to minimize risk to a detainee. He decried the practice of confining detainees undergoing the treatment into a “five-point restraint chair” – during which a detainee’s head and limbs are tied down.

“It’s a form of punishment that is wrapped around the business” of feeding the detainee, Miles said.

Miles dismissed a suggestion from Justice Department attorney Patrick Davis that restraining a noncompliant detainee was necessary for the safety of Guantánamo staff, saying, “in 20 years of working in hospitals with proximity to gang activity, I’ve never had to do that.”

According to a court declaration by Colonel David Heath, the detentions commander at Guantánamo, Dhiab has “physically struck a guard with his arm or head” three times since 1 April, a period during which he also “splashed guards with feces and vomit, and one time he attempted to splash the guards, who just narrowly avoided the concoction.”

The forced feedings, Guantánamo and Justice Department officials have asserted, occur only when a detainee’s hunger strike poses a major health risk. But Miles questioned the metrics used at Guantánamo for determining that threshold, saying they overly relied on body weight, to the exclusion of iron levels, calcium levels and red blood cell size, which he testified provide more precise measurements of malnutrition-related dangers.

Davis and his Justice Department colleague Andrew Warden sharply rejected the claim of frivolous force feeding as the government began presenting its own case on Tuesday. Citing unnamed Guantánamo medical staff, the government lawyers said weight loss was one factor among several determining the necessity of the feeding, although it was the most detailed of the government’s public criteria.

Judge Kessler, who briefly ordered a stop to Dhiab’s feeding in the spring, questioned the role of the overall Guantánamo detentions commander in making the ultimate decision for the forced feedings, something Davis called a “formality”.

The Justice Department has opted to present its case without calling any witnesses, relying instead on declarations of Guantánamo personnel – a decision that means Guantánamo detention and medical officials will neither be subjected to cross-examination nor have to testify under oath. The government is expected to conclude its case on Wednesday.