When Matthew Shepard was beaten, tied to a fence and left for dead nearly 20 years ago, his murder became a rallying cry in the gay rights movement.

Other states adopted stricter laws against violence and discrimination, and Congress passed hate crimes legislation bearing Shepard’s name.

Yet in Wyoming, advocates have tried unsuccessfully for years statewide to pass protections for gays in housing and the workplace. They finally scored a victory on Wednesday after trying a different approach: a local ordinance in the college town where Shepard was killed.

The Laramie city council on Wednesday approved a local anti-discrimination ordinance. It voted 7-2 in favor of the measure that prohibits discrimination based on sexual orientation and gender identity in housing, employment and access to public facilities such as restaurants.

“What a day for Wyoming, and what a day for the city that became synonymous with Matthew Shepard’s murder to now step up and do this right thing,” said Jeran Artery, head of the group Wyoming Equality, which has lobbied for anti-discrimination measures at the state legislature.

“And I would really encourage other communities across the state to follow Laramie’s lead,” Artery said.

Local organisers focused their efforts on Laramie after the legislature repeatedly rejected anti-discrimination bills, most recently early this year. The Laramie Nondiscrimination Task Force presented a draft ordinance to the city council last summer.

Representative Cathy Connolly, a Democrat from Laramie, is gay and a professor in the Women’s Studies Program at the University of Wyoming. She has pushed legislation repeatedly to try to pass an anti-discrimination bill at the state level.

“I wasn’t going to get up and say anything tonight, but I decided I have to,” Connolly said at Wednesday’s meeting. “I’m so proud to be a resident of Wyoming tonight, and a member of this community.”

Laramie mayor Dave Paulekas spoke in favor of the amendment before the council vote.

“To me, this is about treating people fairly, it’s about treating people the way I would want to be treated, the way we all expect to be treated,” Paulekas said. “And it’s nothing more than that, in my mind.”

Paulekas said that if Laramie wants to see economic development, it has to be aware that high-tech firms are going to look at how the city treats its citizens.

Council members Joe Vitale and Bryan Shuster cast the only no-votes against the ordinance. Both said they were concerned that the ordinance would trample on city residents’ religious freedoms.

“Enactment of this ordinance will result in discrimination complaints filed against business owners who are simply trying to run their business consistent with their faith,” Vitale said. The council rejected his suggestion that it postpone action on the matter until next year to give the US supreme court and the Wyoming legislature more time to act on the issue.

Judy Shepard, Matt Shepard’s mother, is active in a Denver-based foundation that bears her son’s name and focuses on equality issues.

“I’m thrilled that Laramie’s doing it, at the same time sort of saddened that the state of Wyoming can’t see fit to do that as well,” Shepard told the Associated Press in a telephone interview from Washington before the council vote. “Maybe the rest of Wyoming will understand this is about fellow human beings and not something that’s other than what they are.”

Shepard said some people are still under the misconception that what happened to her son is typical of what happens in Wyoming.

“But I feel like if Wyoming had done more to open the door to acceptance, that kind of reputation would have disappeared very quickly,” said Shepard, herself a Wyoming resident. “Instead of taking advantage of the moment, they just sort of turned around and ran.”

Governor Matt Mead, a Republican, last year went to court to defend Wyoming’s gay marriage ban before federal court rulings from other states blocked the state from further action.

And a handful of Wyoming lawmakers this spring filed a brief urging the nation’s highest court to reject same-sex marriage on the grounds that forcing states to accept it would violate other citizens’ free-speech rights.

Representative Kendell Kroeker, a Republican from Evansville, voted against the anti-discrimination bill this year and was among those who endorsed the US supreme court brief.

“I suppose it’s their right as a city,” Kroeker said of Laramie’s proposal. But he noted such measures grant special privileges to one group over another – an idea he doesn’t support.

Asked about his thoughts on such an ordinance passing in the city where Shepard was killed, Kroeker said: “The Matt Shepard case was a tragedy, but I don’t see how an anti-discrimination ordinance would have stopped somebody from committing that heinous crime.”