Americans have a constitutional right to carry guns openly outside the home, a federal appeals court in San Francisco ruled Tuesday on an issue that has divided federal courts and is likely headed to the U.S. Supreme Court.

The 2-1 ruling by the Ninth U.S. Circuit Court of Appeals in a case from Hawaii may not last long — it was written by one of the court’s most conservative judges, Diarmuid O’Scannlain, whose previous decision striking down a California concealed-weapons law was overturned by the court’s liberal majority. But it highlights a Second Amendment issue the high court has sidestepped since 2008, when it ruled for the first time that the Constitution guarantees the right to possess a handgun at home for self-defense.

Supreme Court intervention in the open-carry issue appears likelier with the widening split among lower courts — three federal appeals courts have found no right to carry guns openly in public — and with the possible addition on the court of President Trump’s nominee, Brett Kavanaugh, to succeed the retiring Justice Anthony Kennedy. As a federal appeals court judge, Kavanaugh has interpreted the Second Amendment broadly, saying in one dissenting opinion that it protects the right to own semiautomatic weapons.

Meanwhile, Tuesday’s ruling potentially applies to gun laws in nine Western states covered by the Ninth Circuit, including California.

“If this ruling stands, states like Hawaii and California will have to allow far more guns on the streets than they do today,” said Adam Winkler, a UCLA law professor who has written extensively on firearms laws.

The court majority said the text of the Second Amendment, which guarantees a right to both “keep” and “bear” arms, showed that it applied outside the home.

“The right to bear arms must guarantee some right to self-defense in public,” O’Scannlain said in an opinion joined by Judge Sandra Ikuta. While the right to “keep” arms protects the “core purpose” of the Second Amendment within the home, he said, “the separate right to ‘bear’ arms protects that core purpose outside the home.”

States do not have to allow everyone to carry guns openly in public and can enact reasonable regulations, O’Scannlain said. But he said a Hawaii law that allows open-carry permits only to those “engaged in the protection of life and property” was unconstitutional because it effectively excluded everyone except police and security guards.

O’Scannlain said his reading of the law was borne out by scholarly commentary from the nation’s early years, like a writer who said in 1803 that in many parts of the U.S. “a man no more thinks of going out of his house ... without his rifle or musket in his hand, than a European fine gentleman without his sword.” O’Scannlain also said some 19th century gun restrictions stemmed from “efforts of many Southern states to disarm free blacks after the Civil War.”

Dissenting Judge Richard Clifton viewed legal history differently, saying states, both Northern and Southern, “have long regulated and limited public carry of firearms.” He also said Hawaii’s gun fatality rate is 4.5 per 100,000 population, the nation’s fourth-lowest rate. California’s rate of 7.9 per 100,000 is the seventh-lowest.

Clifton also said the Supreme Court’s 2008 ruling, and most of the lower courts that have interpreted it, have defined “the core of the Second Amendment as defense of hearth and home.” States, therefore, have more leeway to enact restrictions on gun possession in public, including laws like Hawaii’s, he said.

O’Scannlain was also the author of a 2-1 ruling in 2014 that temporarily struck down a California law requiring local law enforcement permits to carry concealed handguns in public, permits that are largely unavailable in San Francisco and other metropolitan areas of the state. But the full appeals court ordered a rehearing in that case, and a larger panel upheld the law in a 7-4 ruling, which the Supreme Court declined to review.

Since then, the Ninth Circuit has upheld California’s 10-day waiting period for gun purchases and several local gun laws in the state, including Alameda County’s ban on new gun stores within 500 feet of a residential neighborhood or school. The Supreme Court has declined to hear appeals from those rulings.

The National Rifle Association praised Tuesday’s ruling.

“This is a critical issue for law-abiding gun owners,” said the NRA’s Chris Cox.

Alan Beck, a lawyer for the Hawaii man who challenged the state’s law, said the ruling, if it stands, would enhance public safety “because private citizens are now going to be able to defend themselves, especially when police are unable to come to the rescue.”

But attorney Adam Skaggs of the Giffords Law Center to Prevent Gun Violence said the court “ignored historical evidence and Ninth Circuit precedent concluding that strong laws restricting the public carry of firearms are consistent with the Constitution and have been so since the moment America was founded.”

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter: @BobEgelko