SAN FRANCISCO (AP) — Dealing a blow to gun supporters, a federal appeals court ruled Thursday that Americans do not have a constitutional right to carry concealed weapons in public.

In a dispute that could ultimately wind up before the Supreme Court, a divided 9th U.S. Circuit Court of Appeals said local law enforcement officials can place significant restrictions on who is allowed to carry concealed guns.

By a vote of 7-4, the court upheld a California law that says applicants must cite a "good cause" to obtain a concealed-carry permit. Typically, people who are being stalked or threatened, celebrities who fear for their safety, and those who routinely carry large amounts of cash or other valuables are granted permits.

"We hold that the Second Amendment does not preserve or protect a right of a member of the general public to carry concealed firearms in public," Circuit Judge William A. Fletcher wrote for the majority.

The ruling overturned a 2014 decision by a three-judge panel of the same court that said applicants need only express a desire for personal safety.

In a dissent, Circuit Judge Consuelo M. Callahan said the ruling "obliterates the Second Amendment's right to bear a firearm in some manner in public for self-defense."

Three other federal appeals courts have ruled similarly in the past, upholding California-like restrictions in New York, Maryland and New Jersey. In addition, another federal appeals court struck down Illinois' complete ban on carrying concealed weapons.

The 9th Circuit covers nine Western states, but California and Hawaii are the only ones in which the ruling will have any practical effect. The others do not require permit applicants to cite a "good cause." Anyone in those states with a clean record and no history of mental illness can get a permit.

The National Rifle Association called the ruling "out of touch."

"This decision will leave good people defenseless, as it completely ignores the fact that law-abiding Californians who reside in counties with hostile sheriffs will now have no means to carry a firearm outside the home for personal protection," said NRA legislative chief Chris W. Cox.

Gun control advocates and others hailed the ruling.

"This is a significant victory for public safety and for local jurisdictions that apply sensible policies to protect the public," said California Sen. Dianne Feinstein, a Democrat.

The California case began in 2009, when Edward Peruta filed a legal challenge over the San Diego County sheriff's refusal to issue him a permit. Peruta said at the time he wanted a weapon to protect himself, but the sheriff said he needed a better reason, such as that his occupation exposes him to robbery.

Peruta, who is a videographer known for legally challenging local government restrictions, said he is neither a hunter, collector or target shooter but challenged the law because he believed it violated the Constitution. The NRA joined him in fighting the law.

The San Diego Sheriff's Department said Thursday that since the 9th Circuit tossed out the law two years ago, it has received 2,463 applications from people seeking a concealed-weapon permit without having to show good cause.

Sheriff's lawyer Robert Faigan said the department hasn't processed those applications and will continue to hold on to them while it waits to see what the Supreme Court does.

___

This story has been corrected to show that at least three federal appeals courts — not two — have ruled similarly.