The recent introduction of laws that regulate whether transgender people can use the facilities that align with their gender identities has brought the issue of bathroom sex segregation to the forefront of national conversations. Some have proposed that the solution may lie in gender-neutral facilities, while others worry about what the consequences might be. But, while efforts to prohibit gender intermingling in restrooms have taken on a new focus, the roots of the debate date back over a century.

Though the first sex-segregated toilets were established in Paris in the 1700s, regulations requiring that American men and women use separate restrooms got their start in the late 1800s. The first regulation requiring separate toilet facilities for men and women was passed in 1887, when Massachusetts required the establishment of separate privies in businesses. “Wherever male and female persons are employed in the same factory or workshop, a significant number of separate and distinct water-closets, earth-closets, or privies shall be provided for the use of each sex and should be plainly designated,” the law reads. In the next line, mixed use of such facilities is prohibited. Over the course of the next three decades, nearly every state passed its own version of that law.

Get your history fix in one place: sign up for the weekly TIME History newsletter

But the rules that govern who pees where in public spaces were not created simply because of physical differences between men and women that affect how bathrooms are used. “One might think that it makes perfect sense, that bathrooms are separated by sex because there are basic biological differences,” says Terry Kogan, a law professor at the University of Utah. “That’s completely wrong.”

Kogan, who has done extensive research on the history of sex-segregation in public restrooms, tells TIME that the policies came about as a result of social anxieties about women’s places in the world.

MORE: ‘Little Rock Nine’ Student: Transgender Bathroom Debate Is Part of Civil Rights Fight

Social norms of the period dictated that the home was a woman’s place. Even as women entered the workplace, often in the new factories that were being built at the time, there was a reluctance to integrate them fully into public life. Women, policymakers argued, were inherently weaker and still in need of protection from the harsh realities of the public sphere. Thus, separate facilities were introduced in nearly every aspect of society: women’s reading rooms were incorporated into public libraries; separate train cars were established for women, keeping them in the back to protect them in the event of a crash; and, with the advent of indoor bathrooms that were then in the process of replacing single-person outhouses, separate loos soon followed. The suggested layouts of restrooms, says Kogan, were designed to mimic the comforts of home—think curtains and chaise lounges.

“[Ladies’ rooms] were adopted to create this protected haven in this dangerous public realm,” says Kogan.

Today, even though society’s views on women have largely shifted, sex-segregated bathrooms remain the custom.

Why? Because major plumbing codes in the U.S. use a public building’s capacity to dictate how many restrooms should be built, and those codes specify that men and women’s facilities should be separate. The codes even mandate a minimum number of toilets and urinals per sex. Often, those formulas result in more facilities being made available for men than for women, despite famously long lines for ladies’ rooms.

MORE: The Everyday Sexism of Women Waiting in Public Toilet Lines

There have been efforts to chip away at the inequity facing the sexes in bathrooms—in 1987 California signed the Restroom Equity Act, which said new public projects needed to include more restrooms for women. Similar ordinances were adopted in cities across the U.S., but in many places there is still a reluctance to neutralize bathrooms in terms of gender.

As the debate over bathrooms has shifted, some of the arguments policymakers are using to defend the status quo ring may ring familiar to those familiar with bathrooms’ history: the idea that separate facilities will protect women from harm remains. Two North Carolina lawmakers have said that eliminating separate bathrooms would “deny women their right to basic safety and privacy.” Research does show that trans people may be at risk in bathroom situations—a 2013 survey by the Williams Institute found that 70% of trans people reported experiencing denial of access, verbal harassment or physical assault in an attempt to use the bathroom—but Kogan says the idea that all women are in increased danger in mixed or gender-neutral bathrooms doesn’t make sense, as predators “are not waiting for permission to dress up like a woman to go into bathrooms.”

“It’s a total red herring,” Kogan told TIME, “that men will use these new laws related to protecting transgender people as ways to attack women and children.”

Get our History Newsletter. Put today's news in context and see highlights from the archives. 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.

Contact us at letters@time.com.