Eighteen states and Washington, DC, urged the Supreme Court on Thursday to rule that transgender students must be allowed to use school restrooms that match their gender identity, making them the latest players in a case that has highlighted an ideological divide over gender norms and pitted dozens of states against each other.

Led by New York State Attorney General Eric Schneiderman and Washington State Attorney General Bob Ferguson, the states filed a friend-of-the court brief on Thursday supporting 17-year-old Gavin Grimm, who was banned from the boys bathrooms at his Virginia high school.

“Discrimination against transgender people has no legitimate basis, and serves only to injure a group that is feared for being different,” the state attorneys general told the Supreme Court.

Many of their states have transgender protections on the books already, they note, saying those policies improve lives of residents without ill consequences claimed by critics.

"[O]ur shared experience demonstrates that ensuring the civil rights of transgender people — including by allowing them access to common restrooms consistent with their gender identity — creates no public safety or personal privacy threat and imposes no meaningful financial burden," the states say.

New York and Washington state are joined by California, Connecticut, Delaware, Hawai‘i, Illinois, Iowa, Maine, Maryland, Massachusetts, New Hampshire, New Mexico, Pennsylvania, Oregon, Rhode Island, Virginia, Vermont, and the District of Columbia.

In 2014, the Gloucester County School Board restricted single-sex facilities to people of the same “biological gender." Although Grimm won a challenge in a federal appeals court, the judges ruled on a narrow question about deferring to federal agencies when a law itself is ambiguous. They did not directly address whether Title IX of the Education Amendments of 1972, which bans discrimination on the basis of sex, also bans discrimination on the basis of gender identity.

In January, 23 different states filed a brief supporting the school board, arguing that Title IX does not clearly cover transgender discrimination. They say it would overstep the federal government’s authority to withhold money from schools simply because those states don’t share the same interpretation of the law.

In the brief filed Thursday, attorneys general from the more liberal states spoke to the broader Title IX question.

A ruling that holds Title IX does ban transgender discrimination, the states say, could provide “a crucial additional tool for ensuring equality by guaranteeing that transgender people can travel freely across State lines without fearing discrimination by educational institutions receiving federal funds.”

Last week, the Trump administration withdrew guidance, which was created in the Obama era, that said Title IX requires all federally funded schools to give transgender students access to single-sex facilities that match their gender identity.

Since then, both Grimm’s lawyers at the ACLU and the school board’s attorneys have told the Supreme Court the case should proceed.

Attorney General Schneiderman told BuzzFeed News in a statement, “Providing transgender students access to bathrooms that align with their gender identity isn’t just the right thing to do – it’s the law. My office won’t hesitate to act to make sure all students are treated with dignity and fairness.”