A bill that would make South Dakota the first state in the nation to ban transgender students from using public school bathrooms and locker rooms that align with their gender identities is on the brink of becoming law.

House Bill 1008 cleared the state Senate Education Committee Thursday on a 4-2 party line vote and could pass through the Republican-controlled state Senate as early as next week. Having already been approved by the state House of Representatives, the bill would then need only the signature of Republican Gov. Dennis Daugaard to take effect.

One of four anti-LGBT measures introduced in South Dakota this session and part of a raft of anti-LGBT legislation pending nationwide, HB 1008 would restrict access to public school restrooms and locker rooms based solely on a person’s “biological sex,” defined in this bill as “the physical condition of being male or female as determined by a person’s chromosomes and anatomy as identified at birth.” Transgender students, who identify with a gender that differs from the one assigned to them at birth, would be entitled to a “reasonable accommodation” under this legislation – which could include a single-stall, unisex, or faculty restroom, but not the restrooms “designated for use by students of the opposite biological sex if students of the opposite biological sex are present or could be present.”

LGBT advocates believe the bill to be discriminatory and potentially dangerous to children who suffer from gender dysphoria, a condition the Diagnostic and Statistical Manual of Mental Disorders (DSM-5) defines as “clinically significant distress” arising in people whose gender assigned at birth differs from the one with which they identify. As treatment, the DSM-5 recommends a broad set of options including social and legal transition to the desired gender. That process, they argue, would hit a wall without access to facilities that correspond to a person’s gender identity.

“This outrageous legislation is a blatant attack on transgender children,” said Human Rights Campaign President Chad Griffin in a statement. “These vulnerable youth deserve support and solutions to the high rates of discrimination and harassment they already face, not a deplorable message of hatred from their lawmakers.”

Proponents of the measure, however, question the underlying science in the DSM-5. At a legislative coffee event last weekend, Republican state Sen. David Omdahl said he planned to vote for the bill because doctors were “treating the wrong part of the anatomy.”

“I’m sorry if you’re so twisted you don’t even know who you are,” Omdahl said of transgender individuals. “They’re treating the wrong part of the anatomy. They ought to be treating it up here,” he added, pointing to his forehead.

As the transgender community continues to draw more visibility and acceptance, school boards throughout the country have had to grapple with their bathroom policies. In 2014, the Department of Education released guidance stipulating that it considered discrimination based on gender identity to be a form of sex discrimination, which is prohibited under Title IX of the 1972 Education Amendments. But the strength of that interpretation is currently being tested in federal court.

If HB 1008 passes, the Mount Rushmore State will be the first to implement a statewide ban on transgender students from using public school bathrooms in line with their gender identities.