PIERRE, S.D. (AP) — South Dakota’s governor vetoed a bill Tuesday that would have made the state the first in the U.S. to approve a law requiring transgender students to use bathrooms and locker rooms that match their sex at birth.

South Dakota would have been the first state to take such a step. But Republican Gov. Dennis Daugaard rejected the bill after the American Civil Liberties Union, the Human Rights Campaign and transgender students and adults called the legislation discriminatory.

In his veto message, Daugaard wrote that the bill “does not address any pressing issue” and that such decisions were best left to local school officials. The Republican-controlled Legislature approved the proposal last month, with supporters saying it was meant to protect student privacy.

Transgender rights are a new flashpoint in national culture fights following the landmark U.S. Supreme Court ruling that legalized same-sex marriage last year. The high court victory encouraged advocates for lesbian, gay, bisexual, and transgender rights to push harder, prompting backlash from conservatives.

Caitlyn Jenner, the transgender activist and former Olympic decathlon gold medalist, had called on Daugaard to veto the bill.

Other high-profile cases include last week’s vote in North Carolina by the Charlotte City Council to allow transgender people to choose a bathroom. The vote was immediately criticized by Gov. Pat McCrory, who said it denied privacy rights for those who expect to share restrooms or locker rooms only with people born with the same anatomy.

In Texas, Houston voters soundly defeated an ordinance that would have banned discrimination against transgender people after opponents alleged it would allow sexual predators to go into women’s bathrooms.

Daugaard vetoed the measure a week after hearing the personal stories of three opponents of the bill who are transgender in what was his first knowing interaction with transgender people. The governor initially offered a positive reaction to the proposal, but said he needed to research the issue and listen to testimony before making a final decision.

Opponents called the legislation an attack on vulnerable transgender students that would further marginalize them at school. They also criticized comments made by some lawmakers, including Republican Sen. David Omdahl. When asked about the bill in February, he said:

“I’m sorry if you’re so twisted you don’t know who you are,” he said when asked about the bill in February. “I’m telling you right now, it’s about protecting the kids, and I don’t even understand where our society is these days.”

Under the plan, schools would have been required 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 room.

Supporters said the proposal was a response to changes in President Barack Obama administration’s interpretation of the federal Title IX anti-discrimination law related to education. Federal officials have said barring students from restrooms that match their gender identity is prohibited under Title IX.

Republican Rep. Fred Deutsch, the proposal’s main sponsor in the South Dakota House, has said the plan “pushes back against federal overreach and intrusion into our lives.”

Heather Smith, executive director of the ACLU of South Dakota, said Tuesday that schools would have been forced into the tough position of having to choose whether to follow federal Title IX or state law if the governor signed the legislation.

She also said that had the governor signed the bill, her organization would have encouraged any student harmed by the new law to file a federal civil rights complaint.

Opponents of the bill also used a Twitter hashtag created by South Dakota’s Tourism Department to pan lawmakers and take aim at the state’s roughly $3.8 billion visitor industry.

Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.