WASHINGTON — A federal judge in Maryland ruled Tuesday that men and women barred from joining the military because of their transgender status can proceed with a lawsuit seeking to overturn a Pentagon policy blocking their service.

U.S. District Judge George Russell ruled transgender men and women who would otherwise be eligible for military service can proceed with their court challenge to the Pentagon’s partial ban. However, Russell also ruled five of six servicemembers who originally brought the case could not proceed with the lawsuit because they were permitted to remain in the military under the plan implemented by former Defense Secretary Jim Mattis.

The U.S. government had sought to have the lawsuit — one of several cases nationwide challenging the Pentagon order that bans nearly all transgender men and women from enlisting — dismissed from the court, altogether. The Pentagon’s transgender policy was implemented in April after the Supreme Court ruled the Defense Department could move forward with the ban nearly two years after President Donald Trump tweeted his intentions to bar all transgender persons from the military.

The partial ban blocks the vast majority of Americans with a diagnosis of gender dysphoria, the medical condition associated with individuals who do not identify with their birth sex, from serving. It does allow people to enlist with a diagnosis of gender dysphoria who have doctor certification that they have remained stable in their biological sex for 36 months. People who have medically transitioned their sex are disqualified from service.

Senior Pentagon officials insisted earlier this year that the policy was not a blanket ban on transgender men and women serving, contending their decision was based on data collected in a military study. However, Pentagon officials have never made that data public.

Critics of the ban have compared it to the former “Don’t Ask Don’t Tell” policy that barred openly gay people from military service.

In his decision, Russell sided with the plaintiffs' claim of a violation of the 14th Amendment’s Equal Protection Clause, writing the Pentagon policy is not based on a medical condition but on transgender status.

“By its plain language, then, the [transgender policy] discriminates on the basis of transgender status,” the judge wrote. “In addition the … plan categorically bars transgender individuals who have transitioned to their preferred gender — a recommended treatment to alleviate the distress dysphoria causes.”

While Russell dismissed five of the six servicemembers who brought the case to the court, he allowed them the opportunity to alter their lawsuits in the future. The judge allowed Air Force Airman 1st Class Seven Ero George to remain in the suit because the policy appears to bar him from commissioning as an officer. George, the judge wrote, appears otherwise qualified to become an Air Force officer and he had previously indicated he wished to commission into the service’s nursing corps.

Josh Block, senior staff attorney for the American Civil Liberties Union, applauded Russell’s ruling.

“This is a victory for our clients who want the opportunity to serve their country openly and freely in our armed forces,” Block said in a statement. “We will continue to hold the government accountable for their attempts to ban trans people from the military and shut down judicial review of the policy.”

dickstein.corey@stripes.com

Twitter: @CDicksteinDC