By Bob Egelko

The Constitution protects the right to buy and sell firearms as well as the right to own them, a federal appeals court said Monday in reviving a lawsuit challenging an Alameda County ordinance banning gun shops within 500 feet of a residential neighborhood or a school.

If the Second Amendment right to bear arms "is to have any force, the people must have a right to acquire the very firearms they are entitled to keep and to bear," Judge Diarmuid O'Scannlain said in the 2-1 ruling.

The suit was filed by three businessmen who wanted to open a gun store in an unincorporated area of Alameda County, 446 feet away from the nearest home on the other side of Interstate 880. A federal judge ruled that the 500-foot buffer zone was a reasonable measure to protect neighborhoods from gun violence. But the Ninth U.S. Circuit Court of Appeals in San Francisco said more evidence was needed to justify restricting a constitutional right.

The court stopped short of invalidating the ordinance, but told U.S. District Judge William Orrick III to give it tougher scrutiny.

At the least, O'Scannlain said, the county must present some evidence that "gun stores act as a magnet for crime." And if the practical effect of the law is to ban new gun stores -- something the three businessmen claim, and the county denies -- the county must show that such a prohibition is the only available means to reduce crime, O'Scannlain said.

In a brief but caustic dissent, Judge Barry Silverman said the ordinance hasn't interfered with anyone's right to acquire firearms, with at least 10 gun shops operating in the affected areas.

"When you clear away all the smoke, what we're dealing with here is a mundane zoning dispute dressed up as a Second Amendment challenge," Silverman said.

The ruling is one of many attempts by lower federal courts to fill gaps in the Supreme Court's 2009 decision that declared an individual right, under the Second Amendment, to possess firearms for self-defense, but left the scope of permissible government regulation unclear.

Federal courts have upheld San Francisco's ban on high-capacity semiautomatic weapons and its requirement that handgun owners keep their weapons stored and locked. But a federal appeals court has struck down Chicago's ban on firing ranges in that city.

Brandon Combs, executive director of the Calguns Foundation, which joined the gun-shop applicants in challenging the Alameda County ordinance, praised Monday's ruling.

"Given California's legal requirements to use licensed dealers for firearms transfers and background checks, it's important that retailers are able to open their doors -- and keep them open," Combs said.

The county could seek a new hearing, from either the full appeals court or the Supreme Court, or present additional justifications for the law in Orrick's court. County Counsel Donna Ziegler was not immediately available for comment.

Attorney Imran Khaliq, who represented the advocacy groups Law Center to Prevent Gun Violence and Youth Alive, said courts uphold such laws as part of a local government's authority to protect residents' health and safety. He said Oakland, the most populous city in the county, has one of the nation's highest rates of gun violence.

The county "wasn't saying they couldn't open up a gun store, just that this location was not a suitable location," Khaliq said.

(c)2016 the San Francisco Chronicle