Same-sex marriage supporters wave a rainbow flag in front of the U.S. Supreme Court on March 26, 2013, in Washington, D.C. Getty Images

Houston residents voted Tuesday after a long, divisive fight over establishing nondiscrimination protections for lesbian, gay, bisexual and transgender people. After being fiercely contested for nearly 18 months, the ordinance failed to win approval from the city's voters, according to a tweet from the Associated Press.

The broad civil rights bill called for increased protection from discrimination not only for LGBT people but many other categories as well. The ordinance, known as Houston’s Equal Rights Ordinance (HERO), would have prohibited employers, contractors, landlords, home sellers and public accommodations from discriminating based on a person's sexual orientation and gender identity as well as sex, race, color, ethnicity, national origin, age, religion, disability, pregnancy, genetic information, military status, family or marital status, as International Business Times has reported previously.

The protections for sexual orientation and gender identity ignited the most controversy. Opponents of the measure largely focused on a part of the ordinance that related to the use of public restrooms by transgender people, arguing that men could take advantage of the transgender protections and invade “a safe space for women and girls," according to opponents, the Huffington Post reported.

Supporters of the ordinance, including Houston Mayor Annise Parker, a lesbian, have called the “bathroom ordinance strategy” highly misleading and a scare tactic, CBS News reported, and warned that repealing the law could jeopardize major events like the Super Bowl planned in Houston for February 2017.

Texas Gov. Greg Abbott, a Republican, opposes the ordinance.

"Nothing in the equal rights ordinance changes the fact that it is -- and always will be -- illegal to enter a restroom to harm or harass other people," said Houston Unites, the coalition advocating for HERO, in response to an August radio ad that aggressively pushed the “no men in women’s bathroom" argument, the Huffington Post reported. “And the ad leaves out the fact that the law protects tens of thousands of Houstonians from job discrimination based on their race, age, religion, sexual orientation, gender identity, and disability."

The controversy over HERO sparked numerous high-profile endorsements. Celebrities like gay actor Matt Bomer, politicians including Democratic presidential candidates Hillary Clinton and Bernie Sanders and companies such as Apple had expressed their support for the measure.

"Apple is proud to be a part of Houston with four stores that employ over 500 people," the company said in a statement last week, the Huffington Post reported. "Our stores and our company are open to everyone, regardless of where they come from, what they look like, how they worship or who they love. Apple supports Proposition 1 as it sends a clear message that Houston is focused on a future of inclusion, diversity and continued prosperity."

The Houston City Council narrowly approved HERO in May 2014, but a lawsuit demanding a referendum made it to the Texas Supreme Court, which ordered Houston to either repeal the measure or put it on the ballot. Roughly 43 percent of Houston residents told KHOU last month that they backed the bill, while 37 percent said they opposed it. Twenty percent said they were undecided.