South Dakota lawmakers are the first in the nation to pass a bill outlawing transgender public school students from using restrooms and locker rooms consistent with their gender identities.

The bill was approved by the state Senate on Tuesday and now awaits the signature of Gov. Dennis Daugaard (R), who has said it seems like a good idea. The measure would mandate that students use facilities corresponding with their "physical condition of being male or female as determined by a person's chromosomes and anatomy as identified at birth," not the gender with which they identify.

The bill provides that with written parental permission, affected students may request a "reasonable accommodation ... that does not impose an undue hardship on a school district," such as use of a single-occupancy restroom.

A similar bill in Virginia was rejected last week in a House subcommittee. Several other states also have proposed transphobic bathroom bills. If Daugaard signs South Dakota's bill into law, it would be the first in the nation.

The Transgender Law Center lambasted the bill's passage as "distressing and disturbing" and said it believes the legislation violates federal law.

"Every single child, including transgender youth, should have the opportunity to succeed and be treated fairly by our schools and elected officials," the center's executive director Kris Hayashi told The Huffington Post in a statement. If the governor signs the measure, Hayashi said, it will "endanger students and open up South Dakota schools to legal chaos, liability, and the loss of millions in federal funds."

Democrats, arguing against the bill in the Senate on Tuesday, also raised concerns that the measure may trigger the federal government to pull money from public schools, BuzzFeed News noted. Controversy also may prompt a tourism boycott, the Democrats warned.

If the bill becomes law, it will most certainly result in intense emotional pain for transgender children in South Dakota, advocates for the LGBT community warned.

"I feel the pain the transgender kids in South Dakota will feel when they are not allowed to use the bathroom of the gender they know themselves to be," Terri Bruce, a transgender man from South Dakota, wrote in a HuffPost blog Tuesday. "I feel the pain they will feel when they are segregated from their peers because some adults are uncomfortable with them. There will be intense emotional pain. There will be tears. There will be missed school days. There will be suicide attempts. And there will come a day when one of those attempts is completed. I don't think this bill is worth the life of even one child."