Voters in Houston, Texas, the fourth-largest city in the United States, soundly defeated an ordinance that sought to protect a wide range of people from discrimination, including gays, lesbians and transgender residents.

The closely watched referendum on the Houston Equal Rights Ordinance, known as HERO, was viewed as a battle over gay and transgender rights that pitted social conservatives against the city's openly lesbian mayor.

A festive crowd of HERO supporters gathered at a downtown barbecue restaurant to await election results Tuesday night, while opponents gathered at several smaller events.

Opposition to the ordinance was driven by fears that sexual predators dressed as women would enter women’s restrooms, as depicted in one television ad.

A disappointed Mayor Annise Parker, the first openly lesbian mayor in America, denounced the opposition tactics.

"This was a campaign of fear-mongering and deliberate lies," said Parker.

HERO supporters had three times the money of the opposition, but the focus by the anti-HERO forces on the bathroom issue paid off at the polls.

“Extremist, right-wing religionists, people out there on the fringe — and they are a real minority — captured the narrative on this election," said Terri Burke, executive director of the Texas affiliate of the American Civil Liberties Union.

But the Reverend David Welch, a HERO opponent, said fear of predators in public restrooms is valid.

“We have incidents all over America where men who claim to be women, or claim to be transgender, or predators are going into women’s restrooms," said Welch.

Even though HERO was an anti-discrimination measure, many black voters opposed it.

“The black community on [the] whole is not falling for the propaganda that this is a discrimination ordinance," said the Reverend Willie Davis of the MacGregor Palm Community Baptist Church.

Both those who supported the equal rights ordinance and their opponents agree that the fight over this issue is far from over.

"This ordinance, you have not seen the last of it. We are united. We will prevail," Parker said.

That sentiment was echoed by Stacey Long Simmons at the National LGBQT Task Force.

“There are disparities in housing, disparities in education settings, disparities in health care settings, and as many different ways as we can get new laws on the books to protect our transgender, nonconforming community, that’s absolutely what we need to do," Simmons said.

Most business organizations backed the ordinance, and Parker said its defeat could cost Houston economically by undermining its reputation as what she called "a tolerant, welcoming, global city."