California cities and counties cleared an important hurdle in their legal fight to get major oil companies including BP Plc, Exxon Mobil Corp., and Chevron Corp. to pay tens of billions of dollars to deal with the effects of climate change.

The U.S. Court of Appeals for the Ninth Circuit said Tuesday that San Francisco, Oakland, San Mateo County, and other jurisdictions can pursue their lawsuits in state court rather than in a federal venue thought to be more favorable to the energy industry.

The decision doesn’t guarantee the local governments will ultimately prevail, but it paves the way for a full airing of their arguments in state court.

The cities and counties “live another day to put forth their claims and argue their case,” said Hana Vizcarra, a staff attorney at Harvard Law School’s Environmental and Energy Law Program.

“We hold that the state-law claim for public nuisance does not arise under federal law,” Judge Sandra S. Ikuta wrote for a three-judge panel on Tuesday, reviving a case from San Francisco and Oakland. The George W. Bush appointee also penned a related ruling Tuesday that rejected oil companies’ bid to jettison a separate set of climate cases from state to federal court.