HOUSTON -- An ordinance that would have established nondiscrimination protections for gay and transgender people in Houston failed to win approval from voters on Tuesday.

The Houston Equal Rights Ordinance was rejected after a nearly 18-month battle that spawned rallies, legal fights and accusations of both religious intolerance and demonization of the lesbian, gay, bisexual and transgender community.

Full Coverage: Decision 2015

Supporters of the ordinance had said it would have offered increased protections for gay and transgender people, as well as protections against discrimination based on sex, race, age, religion and other categories.

Opponents of the ordinance, including a coalition of conservative pastors, said it infringed on their religious beliefs regarding homosexuality. But in the months leading up to Tuesday's vote, opponents focused their campaign on highlighting one part of the ordinance related to the use of public bathrooms by transgender men and women that opponents alleged would open the door for sexual predators to go into women's restrooms.

Democratic Houston Mayor Annise Parker, who is gay, and other supporters of the ordinance had called this "bathroom ordinance" strategy highly misleading and a scare tactic.

The ordinance was initially approved by the Houston City Council in May 2014 but a lawsuit to have residents vote on the measure eventually made it to the Texas Supreme Court, which in July ordered the city to either repeal the ordinance or put it on the ballot.

Tuesday's referendum drew attention from around the nation, with the measure getting high-profile endorsements last week from the White House, high-tech giant Apple and Democratic presidential candidate Hillary Rodham Clinton. The ordinance also had received support from other members of Houston's religious community.

Campaign for Houston, which fought the ordinance, said opponents included a diverse group of individuals, such as pastors from all denominations and local and state elected officials.

Republican Texas Gov. Greg Abbott released the following statement on Tuesday night:

"Voters in Houston showed values still matter, and they were clear in their opposition to Proposition 1. I applaud the community leaders and pastors in Houston for organizing a strong effort to defeat this measure."

Terri Burke, Executive Director of the ACLU of Texas, released this statement:

"It's a tragedy that Houston remains the only major city in Texas—indeed, the last big city in the United States—that does not extend equal rights protections to all of its residents and visitors. This is not who we are and I hope when this issue arises again, the city's majority will vote and do the right thing. The next mayor and newly elected members of Houston's city council must prioritize the passage of a new equal rights ordinance as quickly as possible.

"Opponents of equality utilized fear-mongering and disinformation to sway Houston voters to deny equal rights and protections to people in this great city, but none of us who have worked to bring equality to Houston are throwing in the towel. We will continue the fight to ensure that everyone can live fairly and equally under the law.

"We have been honored and privileged to host the dedicated staff of the Houston Unites campaign in our headquarters and in our homes. We intend to harness the energy and enthusiasm of everyone who came together for this campaign to continue the fight for equality in Houston and across Texas."