On Wednesday, the Texas Senate passed a bill that would require people to use restrooms and other facilities that match the gender on their birth certificate. The vote, 21 to 10 largely along party lines, came after a contentious five-hour debate on Tuesday in which opponents of the bill argued that the measure will hurt transgender people and supporters argued that it is necessary for privacy and safety.

The primary sponsor of the bill, Republican Sen. Lois Kolkhorst, gave an emotive speech to begin the debate on Tuesday, taking issue with the notion that the bill is a solution in search of a problem, as many of her Democratic colleagues alleged.

“I will tell you as a woman, this is not a joke. This is about dressing rooms, lockers, showers and restrooms. This is about privacy and protection for all people,” Kolkhorst said. “It’s not perfect. It’s not easy when we talk about these issues. Cisgender. Transgender. How many genders are there? Are we created man and woman? Or do we internalize something different?”

And in final words before the vote on Wednesday, as she asked for her colleagues’ votes, she said she was being driven in part by religion. “I think the god I believe in, the cross I wear today, said there was man and woman,” Kolkhorst said, adding that the bill is “an attempt — maybe wrongly, maybe history will prove that it’s wrong — but I believe in my heart an attempt to be as inclusive as we possibly can when we, men and women … find ourselves in the most intimate situations.”

The bill, known as SB6, would affect facilities in public schools, universities and government buildings, though not private businesses. The measure says the use of single-sex facilities should be based on “biological sex” and defines that as the sex listed on one’s birth certificate. Of the 13 states that are considering such measures, Texas may prove to be a bellwether. The bill now moves to the state House of Representatives for consideration.

Kolkhorst and many of her Republican colleagues argued that the measure is not really about transgender people but about deterring predators who might take advantage of policies that allow restroom access based on gender identity — or, as she put it at one point, “those that might in some way use a vague idea of gender identification to go into a private and intimate spaces and do harm.”

Democratic state senators grilled her for hours, asking how such a bill would be enforced and pointing out that predators have not used such policies as cover for illegal actions in the past. Transgender Texans “are just trying to live their lives,” state Sen. Kirk Watson said on Wednesday, arguing that the bill “harms one group under the false pretense of protecting the majority from some amorphous threat.”

Several states, as well as scores of cities and university campuses, have long allowed transgender people to use restrooms based on their gender identity. But in the wake of the Supreme Court’s ruling legalizing same-sex marriage, bathroom access has become a hot-button issue in state-level fights over LGBT rights.

Several Democratic senators characterized the bill as discriminatory and said it could put an already vulnerable population of transgender kids in the state at added risk. “Don’t you see the damage that does to kids, to be humiliated and embarrassed,” state Sen. Sylvia Garcia said on Tuesday, “because they can’t use the bathroom of the gender they identify with?”

Bills in other states have defined “biological sex” in terms that include chromosomes and anatomy. Supporters of the Texas bill repeatedly emphasized that one’s birth certificate can be changed in Texas, suggesting that such language would allow some transgender people to still legally access the facilities that match their sense of self. But opponents of the bill pushed back, arguing that changing that marker is hard in the state because it often involves travel, legal fees and overcoming judges’ “routine” refusals to grant those requests.

“It is a pretty high bar,” Kolkhorst said.

Protesters lined the halls outside the chamber where the debate and an initial vote were held on Tuesday, armed with signs that said “Don’t Discriminate.”

The final vote came after a marathon committee hearing that lasted nearly 21 hours the previous week, where pastors, parents, schoolchildren, state officials, medical professionals and hundreds of others signed up to speak for and against the bill. Many young transgender people also came to speak during the hearing.

Kolkhorst said she was initially moved to propose the bill after the Obama Administration issued guidance last year instructing schools to respect the gender identities of transgender students, guidance that the Trump Administration has since rescinded. And she characterized the bill as creating “objectivity” about gender that the Obama-era guidance lacked. “I’ve learned through these months,” she said on Tuesday. “It isn’t as simple as male and female anymore.”

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Katy Steinmetz at katy.steinmetz@time.com.