South Dakota will be the first state in the U.S. to enact a law requiring transgender students to use bathrooms and locker rooms that correspond to their sex assigned at birth if Republican Gov. Dennis Daugaard signs a bill passed Tuesday by the state Senate.

The Senate voted 20-15 to send the bill to Daugaard, who initially responded positively to the measure but said last week he would need to study it more before making a decision.

Advocates say the bill is meant to protect the privacy of students, but opponents say it discriminates against vulnerable adolescents.

Under the measure, schools would have to provide a "reasonable accommodation" for transgender students, such as a single-occupancy bathroom or the "controlled use" of a staff-designated restroom, locker room or shower area.

Republican Sen. David Omdahl urged other legislators Tuesday to support the bill to "preserve the innocence of our young people."

The American Civil Liberties Union of South Dakota and the LGBT rights organization Human Rights Campaign have been vocal in their opposition to the measure and have called on Daugaard to veto the legislation.

"History has never looked kindly upon those who attack the basic civil rights of their fellow Americans, and history will not treat kindly those who support this discriminatory measure," Chad Griffin, the president of Human Rights Campaign, said in a statement.

Transgender advocates have also criticized comments made by some lawmakers, including Omdahl, about transgender people.

"I'm sorry if you're so twisted, you don't know who you are," Omdahl said at a recent event when asked about the bill. "I'm telling you right now, it's about protecting the kids, and I don't even understand where our society is these days."

Several states have looked at addressing gender and public facilities in the past several years. But South Dakota would be the first state in the nation to put such a measure into law, said Joellen Kralik, a research analyst at the National Conference of State Legislatures.

South Dakota's plan is a response to changes in the Obama administration's interpretation of the federal Title IX anti-discrimination law related to education. Federal officials have said that barring students from restrooms that match their gender identity is prohibited under Title IX.

The Associated Press