San Antonio's leaders on Thursday approved anti-bias protections for gay and transgender residents, despite the disapproval of top Texas Republicans and religious conservatives who packed a City Council hearing and occasionally shamed supporters for comparing the issue to the civil rights movement.

The 8-3 City Council vote in favor of the ordinance was a victory for gay rights advocates and for Democratic Mayor Julian Castro, a top surrogate of President Barack Obama. Castro has called the ordinance overdue in the nation's seventh-largest city, where there is a stronger current of traditionalism and conservatism than other major Texas cities that already have similar gay rights protections.

San Antonio joins nearly 180 other U.S. cities that have nondiscrimination ordinances that prohibit bias based on sexual orientation or gender identity, according to the Human Rights Campaign.

Supporters in red shirts and opponents in blue sat on opposite sides of the ornate council chamber Thursday. Church leaders vowed petitions to recall council members, and the shouts of protesters outside City Hall often carried through the stone walls of the century-old building.

More than 700 people registered to speak Wednesday during a marathon session of citizen testimony that stretched past midnight. Just a few hours later, 100 people signed up Thursday morning to get in a final word before the vote.

Dee Villarubia, 67, said she is a former Air Force officer whose landlord at a San Antonio apartment evicted her two years ago because she is gay.

"When I say the pledge of allegiance, I say 'justice for some' because there's an asterisk that means not me," Villarubia said. "Today, I would take that asterisk away and finally say 'justice for all.'"

The local measure roiled conservatives nationwide and was opposed by big-name Republicans, including U.S. Sen. Ted Cruz and Texas Attorney General Greg Abbott. Abbott, a Republican who is seeking the governor's office, predicted a lawsuit over religious freedoms, though he has not said the state will challenge the ordinance.

Attention intensified after City Councilwoman Elisa Chan was caught on tape calling homosexuality "disgusting" and arguing that gays should not be allowed to adopt. Chan has defended her comments.

"Just because I disagree with the lifestyle of the LGBT community doesn't mean I dislike them," Chan said before the vote. "Similarly, just because one opposes this ordinance, does not mean one is for discrimination."

San Antonio City Attorney Michael Bernard told the council the ordinance would apply to most city contracts and contractors. It prohibits council members from discriminating in their official capacity and forbids workers in public accommodation jobs, such as at restaurants or hotels, from refusing to serve customers based on their sexual orientation or gender identity.

Opponents say the ordinance would stifle religious expression and does not have the support of most of the city's residents.

"The problem I have is that you criminalize us if we speak our faith," said Marc Longoria, 42, a pastor at My Father's House Church. "We are Christians all the time. We don't have an on and off switch."

One side of the room would erupt in cheers or give a standing ovation depending on the remarks toward the 11-member council. Some turned around to address their opponents in the audience directly.

"My parents and my grandparents rode the back of the bus," said Sylvia Villarreal, who urged the council to vote no. "And I say shame on them for comparing this to civil rights."

The measure passed by the council amends protections already in place for discrimination based on race or gender.

Victories for gay rights advocates have been elusive in the Republican-controlled Texas Capitol. They've had more success on a local level: Houston has a lesbian mayor, and Austin offers health benefits for same-sex couples. Dallas, Houston, Austin, Fort Worth and El Paso are among the Texas cities that already have expanded anti-bias ordinances.

Conservative pushback in San Antonio was notable coming on the turf of Castro, a rising star who delivered the keynote address at the Democratic National Convention last year. Castro has contended that San Antonio embraces political values that he says are spreading statewide and will eventually turn Texas blue.

___

Follow Paul J. Weber on Twitter: www.twitter.com/pauljweber