The State Department must reconsider its decision to deny an intersex Navy veteran from Colorado a passport, a federal judge ruled Tuesday, saying the agency’s reasoning behind insisting a person choose a male or female gender when applying for the travel document was not “rational.”

U.S. District Judge R. Brooke Jackson wrote in an order handed down Tuesday in Denver that, “I find that the administrative record contains no evidence that the Department followed a rational decision-making process in deciding to implement its binary-only gender passport policy.

“Therefore, the proper next step is to remand the case to the Department to give it an opportunity either to shore up the record, if it can, or reconsider its policy.”

The finding comes in response to a lawsuit filed in October 2015 by Dana Alix Zzyym of Fort Collins that accused Secretary of State John Kerry and Sherman Portell, director of the Colorado Passport Agency, of discrimination and named them as defendants.

Zzyym’s attorneys hope the ruling, in a case that drew national attention and which they say is the first of its kind, paves the way for an overhaul of how the State Department issues passports to intersex people.

“The judge rightly focused on the State Department’s policy as opposed to one single decision it made to deny our client a passport,” Paul D. Castillo, Zzyym’s attorney, told The Denver Post. “They have to not only revisit our client’s denial, but also the policy.”

Zzyym’s lawsuit, filed by Lambda Legal, a civil rights group representing gays, bisexuals and transgender people, said Zzyym was born intersex, meaning that Zzyym is “neither male nor female.”

The denial violated Zzyym’s constitutional guarantees of equality and liberty, the lawsuit claimed.

While Jackson declined to address Zzyym’s constitutional claims, he wrote that the State Department’s policy did not come from rational process.

“That is not to say that it can’t be done, but the Department’s first effort to get over the arbitrary and capricious hump was not convincing,” Jackson’s ruling states. “The Court remands the matter to the Department for reconsideration.”

He added: “The Court will not address the constitutional issues unless and until it needs to.”

A State Department official said as a matter of policy the department does not comment on pending litigation.

Zzyym, born in Michigan as Brian Orin Whitney, lives in Fort Collins, identifying as neither male nor female. Intersex people refer to themselves using the gender-neutral pronouns “they,” “them” and “their.”

Shortly after Zzyym’s birth, their parents and doctor decided to raise them as a boy. As a result, Zzyym underwent several irreversible, painful and medically unnecessary surgeries that didn’t work, traumatized Zzyym and left severe scarring, the lawsuit said.

Zzyym, who was planning to attend the International Intersex Forum in Mexico City in October 2014, needed to apply for a U.S. passport. Zzyym’s birth certificate identifies their sex as “unknown” and Zzyym’s doctors at the U.S. Department of Veterans Affairs confirm their gender as intersex.

Zzyym’s passport application was denied after Zzyym wrote “intersex” below the sex category and sent a letter requesting to put “X” as an acceptable marker for gender. The lawsuit was then filed on Zzyym’s behalf by Lambda Legal.

Government lawyers argued moving beyond two gender choices for passports would upend officials’ ability to verify identities and backgrounds because of reliance on driver’s licenses and birth certificates issued by states offering only male and female gender options, The Associated Press reported.

U.S. officials also claimed that if the State Department introduced a third sex marker on passports, it could lead to inconvenience and uncertainty if citizens face problems entering countries that do not recognize a third gender marker.

“This may not be an issue that affects many millions of people,” said Harper Jean Tobin, director of policy for the Washington, D.C.-based National Center for Transgender Equality. “But it does in fact affect a small, but significant, number of people who have every bit as much of an expectation as everyone else to have a passport that accurately reflects who they are. It doesn’t hurt anyone else for Dana Zzyym to have an accurate passport.”

Tobin said the order falls in line with national and international movements toward accepting a third marker for official documents.

“The government needs to have a rational decision,” Tobin said. “It needs to think through how it treats people, especially in something as important as their daily lives and ID documents and documents for international travel.”

Castillo called Jackson’s ruling an important victory for Zzyym and other intersex and non-binary citizens who simply want to be recognized and respected for who they are, to live openly and authentically, and to have their government recognize them for who they are. He called on the State Department to overhaul its policies.

“The hope is that the department’s policy will reflect reality,” Castillo said, explaining that cases like Zzyym’s are not so rare. “There are many people across the United States who have a gender other than male or female. This issue isn’t going to go away and it doesn’t involve solely one applicant.”

Up to 1.7 percent of the population are born with intersex traits, the lawsuit said.

Lambda Legal says several countries issue passports with gender markers other than female or male — including Australia, India, Malta, Nepal and New Zealand — and that most countries offering a third gender marker use the non-specific “X” because it is recognized by the International Civil Aviation Organization.

“Today’s decision is great news, but I realize it is the first step in a long battle,” Zzyym said in a statement. “Every day, I am forced to suffer the consequences of decisions made for me as a child. I shouldn’t have to suffer at the hands of my government — a government I proudly and willingly served — as well.

Zzyym added: “It’s a painful hypocrisy that, simply because I refused to lie about my gender on a government document, the government would ignore who I am. I hope the State Department will do the right thing now.”