A federal judge on Friday blocked the military from forcing out a pair of HIV-positive airmen, saying she had seen no evidence that the disease should prevent them from serving.

“These are the kinds of people that it seems to me the military wants to keep in the service,” Judge Leonie M. Brinkema of the U.S. District Court for the Eastern District of Virginia said in court while issuing an injunction. She elaborated in a memorandum, chastising the government for providing “no evidence, whether anecdotal or otherwise, of the effect of HIV on a servicemember’s medical fitness or the military’s readiness.”

Her ruling allows the two airmen who sued to remain in their posts pending trial. Both would otherwise have been terminated in the next few weeks.

“We’re absolutely thrilled,” said Scott Schoettes, an attorney for the airmen from the LGBT civil rights group Lambda Legal. “We look forward to trial in this matter, where we can show HIV status has no bearing on an airman’s ability to serve.”

Both active-duty airmen began antiretroviral treatment after testing HIV positive in 2017, and doctors deemed them asymptomatic and physically fit to deploy. Their commanders agreed. But in November, they were told they would be discharged because personnel with HIV are barred from deploying to the Middle East.

Former defense secretary Jim Mattis pushed to cut from the military anyone who was not deployable worldwide. Schoettes argued in court that the policy was arbitrary because several other HIV-positive airmen have been retained. The airmen also maintain that they can serve in the Middle East and manage the virus with a pill a day and blood tests every few months, which could be sent to a lab. They pointed out that the military does not categorically bar from combat zones people who take daily medication for asthma, hypertension or dyslipidemia.

Brinkema said in court that she was inclined to agree based on the medical evidence. “We’re not talking about a complicated problem,” she said. “It’s probably less complicated than sleep apnea.”

Assistant U.S. Attorney Robert Norway said in court that the military had to consider a “worst-case scenario” — if the medication was lost, a person’s viral load could rise to detectable levels. Because the two men are younger, he said, they are more likely to be sent to the Middle East than those who were not terminated.

Brinkema said studies found that would take weeks; Norway countered that it could take “as little as nine days.”

However, Brinkema questioned why the government had provided no recent medical research to defend its position while the plaintiffs had. In her ruling, she noted that a military-published study from 2015 concluded HIV “has gone from an untreatable disease” to one “that is compatible with active service throughout a full career in the U.S. military.”

In court filings, the government also expressed concern about “transmission of HIV on the battlefield,” including from a “battlefield blood transfusion.” Brinkema dismissed such fears, writing that “HIV is not as easily transmitted as many people believe” and cannot be transmitted at all when a person’s viral load is suppressed by medication.

“Defendants have not identified a single recorded case of accidental transmission of HIV on the battlefield, which is unsurprising given the uncontroverted evidence that even without effective treatment, the risk of transmission through nonintimate contact such as blood splash is negligible,” she wrote.

A servicemember who knows himself to be HIV positive, she acknowledged, could not give blood, but “many servicemembers cannot give blood for various reasons” and are still deployed.

The two airmen filed suit using the aliases Richard Roe and Victor Voe to avoid the stigma of publicizing their HIV status. Voe, who Brinkema noted has deployed to the Middle East twice, came to court Friday in uniform.

“I’m really excited,” he said after the hearing. “This is the first time in two years I’ve had hope.”