The Republican governor of South Dakota on Tuesday vetoed a bill that would have restricted bathroom access for transgender students and made the state the first to adopt such a measure.

Gov. Dennis Daugaard put out a statement late in the day saying that the bill did “not address any pressing issue” facing the state, and that it would have put schools in the “difficult position of following state law while knowing it openly invites federal litigation.”

The measure was pushed by conservative legislators who said it was an effort to protect the privacy of all students. But it appeared to conflict with the Obama administration’s interpretation of federal civil rights law and seemed likely to be headed for a court challenge.

“If and when these rare situations arise, I believe local school officials are best positioned to address them,” Mr. Daugaard wrote in a letter to lawmakers announcing his decision. “Instead of encouraging local solutions, this bill broadly regulates in a manner that invites conflict and litigation, diverting energy and resources from the education of the children of this state.” State Representative Fred Deutsch, the Republican who introduced the South Dakota bill, said he would not seek an override. Mr. Deutsch has said he believed that the federal Education Department had overstepped in its interpretation of Title IX, which bans sex discrimination in federally funded education programs, and that students’ biological sex should determine which restroom they use. Mr. Deutsch said he had spoken with Mr. Daugaard shortly before the veto statement was released.