Conservative Christian campaigners in Houston, Texas, have welcomed the rejection by voters there of an anti-discrimination measure.
However, outgoing Mayor Annise Parker, who had fought for the legislation, described the result as "insulting, demeaning and just wrong".
The Houston Equal Rights Ordinance (HERO) was backed by Parker, the first open lesbian to be elected as mayor of a major US city and local businesses, while prominent Republicans and Christian pastors rallied against the HERO proposal.
The ordinance would have banned discrimination based on criteria including an individual's sexual orientation and gender identity.
Conservative Christians homed in on one of HERO's provisions which they said would allow the use of public lavatories by transgender men and women.
Lieutenant Governor Dan Patrick, a Tea Party Republican, said in an advertisement opposed to HERO: "It's about allowing men into women's locker rooms and bathrooms. No woman should have to share a public locker room or restroom with a man."
Fox News contributor Erick Erickson said after the vote: "Tonight, the people of Houston fought back and rejected the attempt to allow perverts, the mentally ill, liars, and others who want to get in to opposite sex bathrooms.
"Christians and common sense won. Perverts, the mentally ill, and the gay rights mob lost.
"It remains unscientific that men can be women and women can be men. But it has become an article of faith to the supposedly pro-science left – an article of faith rejected by the people of Texas."
The HERO campaign was marked by considerable bitterness and controversy. An attempt to have it put to the vote was resisted by Mayor Parker and the city council, who attempted to subpoena the sermons and other communications from five pastors who had opposed the legislation. They withdrew the move after a public outcry.
The Texas Supreme Court ordered the city to put the legislation to a vote and subsequently struck down the wording of the ballot it proposed to put to voters. In the end HERO was overwhelmingly rejected, by 62-38 per cent.
Erik Stanley, a spokesman for Alliance Defending Freedom, which had campaigned vigorously against the legislation, said in a statement: "Democracy prevailed, despite the city's anti-democratic actions and the intimidation tactics of the mayor and her staff. When the dust settled, the people of Houston sent a message – they will not be intimidated or fooled by a swarm of celebrities and millions of outside dollars into abandoning the First Amendment and the safety of women and girls."
In a hard-hitting speech after the vote, Parker said the result was "insulting, it is demeaning, and it is just wrong".
She continued: "This was a campaign of fear mongering and deliberate lies. Deliberate lies. This isn't misinformation, this is a calculated campaign of lies designed to demonize a little-understood minority, and to use that to take down an ordinance that 200 other cities across America, and 17 states have successfully passed, and operated under."
She concluded: "They just kept spewing an ugly wad of lies from our TV screens and from pulpits. This was a calculated campaign by a very small but determined group of right-wing ideologues and the religious right, and they know only how to destroy, not how to build up."