SAN FRANCISCO — In a decision sure to ignite a political firestorm, the Ninth Circuit ruled Thursday that the Second Amendment guarantees individuals the right to bear arms not only in the home, but also in public.

A divided panel led by Judge Diarmuid O’Scannlain ruled that, under the logic of the U.S. Supreme Court’s landmark 2008 decision in District of Columbia v. Heller, California must allow law-abiding citizens to carry weapons, and that the right is not subject to balancing against the state’s interest in public safety.