The U.S. 9th Circuit on Tuesday upheld an Alameda County law barring gun stores within 500 feet of residential properties in a blow to gun rights advocates.

The ruling came from a 9-2 en banc panel of the court in a case brought by gun dealers and Second Amendment groups who contended the county’s zoning effectively put it off limits to new gun stores. The court held that local governments could regulate the sale of firearms so long as would-be buyers were still able to purchase them somewhere in the area and that the Second Amendment does not protect the ability to engage in gun sales.

Writing for the majority, Judge Marsha Berzon noted that there were numerous gun stores, including a Big 5 Sporting Goods outlet, located in the County that had been in operation before the 500-foot rule came into effect, and the new zoning restriction did not burden the right to keep and bear arms as it just limited the ability to open new gun stores.

“In any event, gun buyers have no right to have a gun store in a particular location, at least as long as their access is not meaningfully constrained,” said Berzon.

The case was brought in 2012 by businessmen John Teixeira, Steve Nobriga and Gara Gamaza who found that the county’s zoning made it impossible to find a commercial property available for which they could open a new gun store.

The men attempted during a two-year period to comply with the county to serve the San Leandro area and were initially granted a variance from the 500-foot rule to lease a location 446 feet away from a residential area. However, the Board of Supervisors reversed their decision after a local homeowners’ association who were “opposed to guns” objected, leading the entrepreneurs to seek redress with the courts.

While a District Court upheld the rule, a split three-judge panel of the 9th Circuit in 2016 found Alameda County’s regulations unconstitutional on Second Amendment grounds. The majority noted that county officials should provide evidence showing, for instance, that gun stores increase crime to justify such regulations. That decision, however, was vacated and the case sent for retrial before the larger en banc panel earlier this year.

In standing fast against the majority opinion in this week’s ruling, two judges, Carlos Bea and Richard Tallman, wrote scathing dissents with the latter chastising the panel for their logic.

“The impact of this county ordinance on the fundamental rights enshrined in the Second Amendment cannot be viewed in a vacuum without considering gun restrictions in California as a whole,” said Tallman. “I fear today’s decision inflicts yet another wound on our precious constitutional right.”

The jurist also called attention to the continuing trend in anti-gun rulings issued by the 9th Circuit, which has upheld a string of California laws limiting gun rights.

“Our cases continue to slowly carve away the fundamental right to keep and bear arms,” said Tallman. “Today’s decision further lacerates the Second Amendment, deepens the wound, and resembles the Death by a Thousand Cuts.”