(CNN) South Dakota Gov. Dennis Daugaard on Tuesday vetoed a bill that would have required transgender students in the state's public schools to use bathrooms and locker rooms that matched their sex at birth.

That would have restricted access to school restrooms and locker rooms to students of the same biological sex.

In issuing his veto, the Republican governor said the bill, known as HB 1008 , "does not address any pressing issue concerning the school districts of South Dakota. As policymakers in South Dakota, we often recite that the best government is the government closest to the people.

"Local school districts can, and have, made necessary restroom and locker room accommodations that serve the best interests of all students, regardless of biological sex or gender identity," Daugaard said.

"This bill seeks to impose statewide standards on 'every restroom, locker room, and shower room located in a public elementary or secondary school.' It removes the ability of local school districts to determine the most appropriate accommodations for their individual students and replaces that flexibility with a state mandate."

The decision was applauded by transgender rights advocates.

"Gov. Daugaard made the right call in vetoing this dangerous legislation, sparing South Dakota the risky and costly experiment of becoming the first state to mandate discrimination against transgender youth in violation of federal law and student privacy and well-being," said Kris Hayashi, executive director of Transgender Law Center.

Sarah Kate Ellis, the president and CEO of GLAAD, added, "By vetoing this bill, the governor has sent a clear message that discrimination is not a South Dakotan value ."

The legislation cruised through the Republican-led House in January in a 58-10 vote, then passed the Senate by a 20-15 vote in mid-February. After receiving the bill last week, the governor had given no indication which way he was leaning.

He had until midnight Tuesday to issue a veto. If he had not acted, the bill would have become law.

State Rep. Fred Deutsch, who wrote the bill, said the issue had become a distraction for the state and that he would ask his colleagues "to concur with the governor's veto."

"Further focus on this issue will detract from the other significant accomplishments of the Legislature this session," Deutsch said.

Similar bills proposed in other states

The bill's text did not use the word "transgender," the term for people who don't identify as the gender they're born as and who often take steps to change their gender. Yet that group is the one that will be most affected, as evidenced by the bill's defining "biological sex" as "the physical condition of being male or female as determined by a person's chromosomes and anatomy as identified at birth."

If it had become law, that didn't mean someone who identifies as a girl, but was born a boy, would necessarily have to go to a boys' restroom. Rather, it called for transgender students to be given "reasonable accommodation" -- specifically, the use of a "single-occupancy restroom, unisex restroom or the controlled use of a restroom, locker room or shower room."

The bill also dictated that a school district face no "undue hardship" under any new requirement, like being forced to build (and pay for) separate restrooms for transgender students. And private schools would have been exempt from the "reasonable accommodation" clause.

In issuing his veto, the governor said, "This law will create a certain liability for school districts and the state in an area where no such liability exists today.

"For these reasons, I oppose this bill and ask that you sustain my veto."

Similar bills have been proposed in Illinois, Indiana, Kentucky, Massachusetts, Mississippi, Missouri, Oklahoma, Tennessee, Virginia, Washington and Wisconsin. But South Dakota is the closest to having legislation passed.

Strong feelings on both sides of debate

Transgender students and their families met last week with Daugaard to press their case.

"It singles out transgender individuals and forces them to use something that they're not comfortable using," Nathan Leonard, a transgender teen and high school freshman from Watertown, told CNN last month.

From left to right, transgender students Scout Brown, Nathan Leonard and Thomas Lewis.

Those on the other side of the debate said the measure was important to ensure all students' privacy.

One Sioux Falls father, who did not want to be named, said he supported the measure in part because of his concerns about the bullying of transgender students. He also did not want his own son to have to use the same bathroom as transgender students.

"I don't think I'd want my 16-year-old boy in the bathroom with a transgender student if that student had a radically different look, like someone who changed from a girl to a boy and might have a beard now," the father said.