After scoring wins for same-sex marriage rights and anti-discrimination protections, U.S. equality advocacy groups now find themselves in a battle over bathrooms.

North Carolina last week became the first state to enact a law requiring transgender people to choose restrooms that match the gender on their birth certificate rather than the one with which they identify.

At least 13 other states also have considered so-called bathroom bills targeting the transgender community this year, according to the National Conference of State Legislatures. The measures, which have sparked heated debate between supporters and opponents about privacy and safety expectations, have had mixed results in statehouses.

"Most of these bills didn’t even make it to a committee vote," said Cathryn Oakley, senior legislative counsel for the Human Rights Campaign, a lesbian, gay, bisexual and transgender advocacy organization. "They’re such a bad idea, they didn’t actually go anywhere."

In North Carolina, the key exception, Republican Governor Pat McCrory has defended his state's law.

"Legislation was passed to protect men, women and children when they use a public restroom, shower or locker-room," he said in a statement on Tuesday. "That is an expectation of privacy that must be honored and respected."

South Dakota's Republican governor, however, vetoed legislation earlier this month that sought to dictate what bathrooms transgender students could use in public schools. A similar bill in Tennessee appears stalled in committee, though opponents are awaiting a hearing on the matter next week.

Measures also failed last year in eight states that tried to restrict access to sex-segregated facilities based on birth gender, the National Conference of State Legislatures said.

This year's proposals are among the nearly 200 anti-lesbian, gay, bisexual and transgender bills civil rights organizations are tracking across the country, a record that is about twice as many as in 2015, Oakley said.

BATHROOM WARS

Bathroom wars have a long history in the United States. Jim Crow laws, which enforced racial segregation on state and local levels in the South, forced African Americans to use restrooms that were separate from those used by whites into the mid-1960s.

The latest fight is unfolding along with legislation introduced after a U.S. Supreme Court ruling last year legalizing same-sex marriage.

Social conservatives have pushed measures allowing people to deny services to lesbian, gay, bisexual and transgender men and women on the grounds of religious beliefs.

Governors in Georgia and Virginia vetoed such bills this week, saying they could have allowed state-sanctioned discrimination.

North Carolina's new law goes beyond what bathrooms transgender people are allowed to use.

As part of the measure, lawmakers also established a statewide nondiscrimination policy that protects people on the basis of race, religion, color, national origin and biological sex but not gender identity and sexual orientation. The law effectively blocks local governments from passing their own anti-discrimination ordinances that include those broader protections.

That leaves the lesbian, gay, bisexual and transgender community vulnerable to discrimination at work and public places such as hotels and restaurants, said Wake Forest University law professor Shannon Gilreath. He called the measure the most anti-gay legislation in the United States.

"Bathrooms are such a small part of it," said Gilreath, an expert on gay rights issues. "Gays and lesbians have been robbed of so much more."

McCrory said the claims that anti-discrimination protections have been eroded are untrue. North Carolina, which now faces a federal lawsuit over the law, has been the target of a "vicious, nationwide smear campaign," he said.

It is unclear how the state's bathroom provision will be enforced. The law establishes no penalties for violators, though legal experts and lawmakers suggested charges could be issued under trespassing or public nuisance statutes.

Rose Saxe, senior staff attorney at the American Civil Liberties Union, said state agencies, public schools and universities will have license to act as "potty police."

"Who gets asked to provide their papers before going into a bathroom is left unknown," she said.