The Department of Defense will soon receive formal guidance from President Donald Trump regarding transgender people in the military — and LGBTQ groups are polishing their swords in anticipation of a legal showdown.

On July 26, Trump declared on Twitter that transgender individuals would be barred from serving in “any capacity” in the U.S. military. Now, nearly a month later, the White House has prepared a memo detailing what the ban will look like and how it will be implemented. Under the new guidelines, according to the Wall Street Journal, the Pentagon will have authority to reassess the deployability of transgender troops, and boot out service members deemed non-deployable under the new guidance. This piece is the biggest question mark, because it basically leaves it up to Defense Secretary Jim Mattis how vigorously he wants to enforce the new guidelines.

It also reportedly bans the Pentagon from recruiting trans Americans in the future, and cuts off funding used to pay for gender reassignment surgery or other transgender-related medical costs. Mattis will reportedly have six months to implement the new rules. “This is evidence that they are moving forwards to get rid of highly trained, well-qualified active service members who are contributing at high levels,” said Jennifer Levi, director of GLAD’s Transgender Rights Project.

Trump’s three-tweet policy statement plunged the lives of as many as 6,000 transgender active service members into uncertainty, and caught Pentagon officials off-guard. While the Department of Defense awaited further direction from the White House, five trans active service members backed by GLAD and the National Center for Lesbian Rights preemptively filed suit against their Commander in Chief and top Pentagon officials.

From what Levi understands so far, nothing in the anticipated formal guidance from the White House changes their legal strategy. The lawsuit filed Aug 9 in the U.S. District Court for the District of Columbia argues that the ban “lacks a rational basis, is arbitrary, and cannot be justified by sufficient federal interests,” and violates transgender troops’ right to equal protection and due process under the Fifth Amendment. Lambda Legal, another LGBTQ legal advocacy group, told VICE news that they are planning to sue over the ban, but couldn’t provide more details at this time.

What lies ahead is a protracted legal fight that will look familiar to anyone who followed the Trump administration’s attempt to limit travel from majority-Muslim countries.

“What we’re seeing play out is what we saw play out in the Muslim ban,” said Tom Kolditz, director of Rice University’s Doerr Institute and a retired brigadier general. “Donald Trump made a blanket statement banning an entire class of people, and now his staff is scrambling to come up with a justifiable rationale.”

The new guidelines will reportedly require U.S. military to consider whether an individual could be deployed in a conflict when weighing whether to discharge a transgender service member. But Kolditz, who served on two national commissions studying transgender service members in the military, says that the “deployability” question has already been looked at.

“The military has its own standards for evaluating medical conditions for deployment, whether you are transgender, have bad knees, or flat feet,” Kolditz said. “They might talk about the severity of someone’s gender dysphoria, which can usually be successfully treated by drugs commonly available overseas. If it can’t be managed, that person is probably unsuitable to be in the military.

Just as Trump’s previous statements about banning an entire class of people (Muslims) came back to haunt him as the “travel ban” made its way through the courts, Kolditz anticipates that the president’s declaration barring transgender troops will provide similar obstacles. Even if the president and his lawyers make the ban about “deployability,” the initial ban was delivered in a blanket statement against any and all transgender people in the military. Similarly, Trump’s past statements about wanting to implement a Muslim ban undercut his later assertion that the travel ban had nothing to do with religion.

Whether the military will cover transgender soldiers’ medical bills also comes with its own set of problems. Kolditz points out that men undergoing hormone replacement therapy to become female will generally take estrogen, which is also often taken by women who are not transgender for a variety of reasons, including menopause relief or in combination with other drugs for birth control. “To say we won’t pay for this medication for a transgender soldier, but we will for a women?” Kolditz said. “It’s hard to imagine something more discriminatory than that.”