The war on natural gas is escalating.

Berkeley, Calif., the Bay Area city known for its progressive politics, has banned the use of natural gas in most new buildings. Environmentalists say it is the first city to enact such a prohibition. San Jose, San Francisco, and dozens of other California municipalities are said to be considering similar bans in the battle against global warming.

The unanimous vote by the Berkeley City Council may be a harbinger of a larger shift in some states to push American consumers away from natural gas, a cleaner-burning fossil fuel that has helped reduce carbon emissions by displacing coal in electric-power generation. But climate advocates say the large-scale switch to gas is slowing down the transition to renewable energy, and threatens to undermine carbon-free nuclear power.

In Philadelphia, climate activists are pressuring City Council to wean the city off natural gas. The city is undertaking a study to explore a “just transition” for Philadelphia Gas Works, the nation’s largest municipal utility, and is expected to be completed by the end of 2020.

Philadelphia, along with many other cities, has adopted a formal pledge to uphold the goals of the Paris climate accords, which call for an 80 percent reduction in carbon emissions by 2050.

Berkeley had adopted a plan a decade ago to reduce its 2000 greenhouse gas emissions by a third by 2020, but the city has only managed to reduce emissions by 15 percent. Natural gas accounts for 27 percent of the city’s greenhouse gas emissions, Berkeley officials said.

Pacific Gas and Electric Co., the embattled California utility that provides natural gas service to Berkeley, endorsed the city’s ban on new gas hookups. As the city’s electricity provider, PG&E would also likely gain by picking up new electricity sales. According to PG&E, nearly 80 percent of its power is generated from renewable sources like solar, wind and hydro, or from nuclear energy.

Outside of California, other utilities are shifting away from adding new natural gas customers, but not willingly.

In New York, Consolidated Edison and National Grid have put a moratorium on accepting new natural gas customers because Gov. Andrew Cuomo’s administration has blocked the expansion of new gas pipelines. The utilities say they can’t guarantee they will have enough gas to supply new customers.

Pennsylvania, which has become the nation’s second-biggest natural gas producer, has taken almost the opposite position. State government’s policy is to encourage retail customers to switch from oil, propane, and electricity to natural gas, which is produced in abundance from the state’s Marcellus Shale gas region.

Philadelphia’s situation is not exactly comparable to Berkeley’s. Residential customers in the Northeast are more likely to consume large amounts of natural gas in the winter to heat their homes, compared with California homeowners. It costs more to heat with electricity.

And unlike PG&E, which loses nothing if customers switch from gas to electric, the city-owned Philadelphia Gas Works is strictly a gas utility, so it has no incentive to encourage customers to leave its system for a rival energy supplier.