Advocates for government assistance for transgender persons who are getting transition-related medical care sought a lasting victory Thursday before the Iowa Supreme Court.

A judge has already ruled in their favor, reversing the state's decision to deny Medicaid coverage to two transgender women. The state appealed, and the Iowa Supreme Court heard the case Thursday.

John Knight, an attorney for the American Civil Liberties Union, argued that Iowa's Medicaid ban on transition-related care discriminated unlawfully on the basis of gender identity.

"This surgery is medically necessary," Knight said, calling it a life-saving treatment for his clients and other people. "This is not cosmetic surgery."

Assistant Attorney General Matthew Gillespie, who represented the Iowa Department of Human Services, said the women's attorneys failed to show discriminatory intent. The case, he said, was really about whether the state appropriately denied coverage for surgeries performed primarily for psychological purposes.

"This case is not about transgender Iowans at all," Gillespie said, saying the issue was about whether surgery was for psychological or physical purposes.

The women, Carol Ann Beal of northwest Iowa and EerieAnna Good of the Quad Cities, filed a lawsuit challenging the ban after years of denials. In June, Chief District Judge Arthur Gamble ruled in favor of the women, agreeing the ban violated the Iowa Civil Rights Act and the state constitution's equal protection clause.

Good, 28, and Beal, 42, were diagnosed with gender dysphoria, a medical condition their attorneys described as the feeling of "incongruence" between a person's gender identity and their birth-assigned sex. The women's health care providers "uniformly concluded" their treatments required surgery, according to a brief they filed before Thursday's arguments.

The earlier ruling invalidated the part of the rules governing Medicaid in Iowa that classified transition-related surgeries as "cosmetic, reconstructive or plastic surgery" and banned coverage for surgeries for the purpose of sex reassignment. The code excluded procedures for "gender identity disorders or body dysmorphic disorders."

MORE: 'I feel alive': Transgender Iowans on medical care, surgeries

Unlike cosmetic surgery for appearance, the women's attorneys said, gender-affirming surgery is intended to address the "life-altering — and, at times, life-threatening — consequences" of gender dysphoria, which can lead to extreme depression.

State: Rules are not discriminatory

As he began his argument for the state, Gillespie said the case was not about whether transgender Iowans have suffered from discrimination. It was about the purpose of the surgeries, he said: Transgender Iowans are treated like anybody else when they are excluded from coverage for surgeries "performed primarily" for psychological purposes, he argued.

The women's attorneys said nontransgender persons receive Medicaid coverage for surgeries that include treatment for post-traumatic reconstruction, post-infection reconstruction and scar removal.

The women's attorneys said the decades-old administrative rule singled out transgender Iowans. When prescribed by a doctor, forms of transition care, including surgeries, are recommended by most professional medical organizations, they said. (The district court ruling said the Department of Human Services had an "obligation to keep up with medical science.")

State attorneys have said that gender identity "plays no role" in whether Iowans are covered when they request a procedure.

In answering a justice's question, Gillespie said there were no federal rules that required the Iowa rules to make the distinction. About half of U.S. states have similar bans, he said.

MORE: The Register's 'Trans in Iowa' series

Under the state constitution, Gillespie said, not all medically necessary services are required to be covered. Human services noted the cost of transition-related care, with Gillespie adding Thursday: "The department has a limited number of funds."

"We're limited in what we can cover and what we can do," he said.

Who is affected, and how much money is at stake

Tabulating the cost of transition is difficult because of the variation of care needed or desired. One center priced the full suite of procedures at more than $100,000, while single surgeries, such ones that create a vagina or a penis, cost about $20,000.

Gender identity and sexual orientation were added to the Iowa Civil Rights Act as protected classes in 2007, giving transgender Iowans legal protections against discrimination in education, employment, housing and public accommodations. A state and federally funded program, Medicaid is considered a public accommodation.

Transgender people reportedly make up about 0.3 percent of the total population — or about 964,000 people nationally and 9,300 in Iowa, according to the Williams Institute, a think tank at UCLA's law school. A smaller subset of that population seek surgeries.

The women's attorneys said attempted-suicide rates among people without access to gender-dysphoria treatment was more than 40 percent, compared with about 4.5 percent throughout the country's overall population. Knight said the exclusion makes it difficult for transgender Iowans to function, describing his client's lives as "on the line here."

In an amicus brief, officials at One Iowa, the state's largest LGBTQ organization, said they have seen how "powerful, life-changing and absolutely essential" gender-affirming surgery can be for many gender-dysphoria patients.

"Since I got the surgery, those (suicidal) thoughts are gone just gone," one Iowa woman, who received gender-affirming surgeries through her job's insurance, said in the brief. "For me, completing transition allows me to be a full part of society."

Follow the Des Moines Register on Facebook and Twitter for updates.