Editor's note: This story has been updated throughout.

After months of sparring over whether transgender Texans should be allowed to use bathrooms that align with their gender identity, Republican Lt. Gov. Dan Patrick on Thursday officially set the legislative stage for the debate.

Following North Carolina’s lead, Texas Republicans announced Senate Bill 6, which would require transgender people to use bathrooms in public schools, government buildings and public universities based on “biological sex” and would pre-empt local nondiscrimination ordinances that allow transgender Texans to use the bathroom that corresponds with their gender identity.

“We know it’s going to be a tough fight,” Patrick said at a Capitol news conference announcing the bill. “But we know we’re on the right side of the issue. We’re on the right side of history. You can mark today as the day Texas is drawing a line in the sand and saying no.”

Patrick said his support for the legislation is based on privacy concerns, arguing that such policies allow men to enter women’s restrooms and locker rooms.

Republican state Sen. Lois Kolkhorst of Brenham, who will guide the bill through the upper chamber, said SB 6 would still allow for accommodations for transgender students, such as single-stall restrooms, on a case-by-case basis. But public entities that violate bathroom policies based on “biological sex” will be subject to a civil penalty imposed by the state attorney general.

It also appears to essentially exempt convention centers, stadiums and entertainment venues. The legislation would not apply if “if the location owned by a government entity is privately leased to an outside entity," which is often the case for those sort of venues, Kolkhorst said.

SB 6 was filed despite fierce opposition from state business groups and LGBT advocates who have decried the proposal as discriminatory against transgender people. They’ve argued there’s little evidence that nondiscrimination policies — including those in place in major cities across the country — allow sexual predators to freely enter women's restrooms and locker rooms.

“Any legislation that would seek to target any group of people for discrimination, I would contend, is morally bankrupt and wrong,” said Chuck Smith, executive director of Equality Texas, following the announcement. “And I would hope most lawmakers could take a stand on the legislation and oppose it solely for those reasons.”

Advocates have also warned Texas leaders against taking cues from North Carolina, where similar legislation was challenged in court and cost the state millions of dollars. "That's something that can't be ignored," Smith said.

“ We know it’s going to be a tough fight, but we know we’re on the right side of the issue. We’re on the right side of history. You can mark today as the day Texas is drawing a line in the sand and saying no. ” — Lt. Gov. Dan Patrick

North Carolina lawmakers passed their own legislation last year in response to a Charlotte nondiscrimination ordinance that extended protections to transgender residents who use public facilities based on their gender identity.

The North Carolina legislation not only eliminated Charlotte’s ordinance but also nullified local ordinances that extended protections for LGBT residents. That legislation also kept transgender people who haven’t had surgery or legally changed their gender markers on birth certificates from having the legal right to use a public restroom that matches their gender identity.

Officials there argued that private businesses could establish their own practices, but the legislation cost the state millions in cancellations: The NBA announced it would pull an All-Star Game from Charlotte that was scheduled for this year; performers canceled concerts; business expansions were scrapped; and the NCAA moved seven championship games during the 2016-17 school year out of the state.

The Texas Association of Business — a top business lobby group that regularly sides with conservatives — has warned that anti-LGBT legislation, including SB 6, could lead to similar, costly economic fallout in Texas.

In a report released late last year, the group estimated that such legislation could cost the state between $964 million and $8.5 billion and more than 100,000 jobs. Patrick’s team has dismissed those estimates as “misinformation and fearmongering.”

The legislation regulating bathroom access will also probably reignite the fight over local control when it comes to protections for LGBT residents.

Citing bathroom safety concerns, Patrick first waded into the fight in 2015 as part of his opposition to a Houston ordinance, known as HERO, that would have made it illegal to discriminate against someone based on 15 different “protected characteristics,” including sex, race, religion, sexual orientation and gender identity.

The Houston ordinance was eventually shot down by voters, but as of last summer there were still 12 Texas cities with populations of more than 100,000 that had some rules or legislation in place to protect residents or city employees based on sexual orientation or gender identity.

Some of the state’s biggest cities, including Dallas, Austin and Fort Worth, have had comprehensive ordinances on the books for a decade, offering transgender residents some degree of protection against discrimination in employment, housing and other public areas such as buses, restaurants and bathrooms.

Patrick leaned heavily on HERO’s demise on Thursday in arguing that public opinion is on his side, but it remains unclear how far Patrick’s proposal, which he’s listed among his top legislative priorities, could go in the Republican-controlled Legislature.

House Speaker Joe Straus has downplayed the urgency of such legislation, saying Patrick’s proposal is not “the most urgent concern of mine.” Meanwhile, Gov. Greg Abbott in December took a wait-and-see approach regarding the legislation. While it’s been unclear whether Abbott views the issue as a priority, he has said it’s “something that needs to be looked at.”

The legislative fight over bathroom use by transgender Texans comes months after the state challenged the Obama administration’s guidelines saying schools must treat a student's gender identity as the student's sex to comply with with federal nondiscrimination statutes.

Those guidelines, which allowed transgender students to use bathrooms and other facilities that align with their gender identity, were blocked by a Texas federal judge in August. But Kolkhorst cited that “federal edict” and “divisive ordinances such as HERO” in explaining why she filed SB 6.

“I filed this legislation not to start a controversy but to end one,” Kolkhorst said amid loud booing from protesters lined up outside the Senate chamber.

Read related Tribune coverage:

For Benjamin Elder, a transgender 10-year-old from Friendswood, the bathroom fight in Austin is just silly.

A Texas judge issued a nationwide injunction against a federal mandate aimed to protect transgender people, finding that the federal health rule violates existing law.

Disclosure: The Texas Association of Business has been a financial supporter of The Texas Tribune. A complete list of Tribune donors and sponsors can be viewed here.