Some of the world’s largest listed energy companies are facing a lawsuit for “billions of dollars” after New York City accused them of contributing to climate change.

The city also said it would start analyzing ways to divest its pension funds, which have $189 billion in assets, of fossil fuel companies “in a responsible way that is fully consistent with fiduciary obligations.”

Mayor Bill de Blasio said the city was seeking damages from BP, Chevron, ConocoPhillips, ExxonMobil and Royal Dutch Shell to “protect New Yorkers from the effects of climate change.”

“We’re bringing the fight against climate change straight to the fossil fuel companies that knew about its effects and intentionally misled the public to protect their profits,” said de Blasio.

The same five companies are fighting court cases in California brought by cities and counties over the harm they expect to suffer from climate change.

Exxon in a court filing this week described those actions as “abusive law enforcement tactics and litigation” that were attempting to stifle the company’s right to “participate in the national dialogue about climate change and climate policy.”

The New York mayor’s office accused the energy companies of being aware of the effects that burning fossil fuels would have on the planet’s atmosphere, citing “recently uncovered documents”.

“They deliberately engaged in a campaign of deception and denial about global warming and its impacts, even while profiting from the sale of fossil fuels and protecting their own assets from the effects of rising seas and a changing climate,” the city said.

Exxon claims that the campaign arguing it understood the risks of climate change in private while minimizing them in public was “a complete fabrication that was conceived, paid for, and executed by anti-oil and gas activists.”

It said reporting on the issue had “cherry-picked statements from company officials and misrepresented the context of other events and statements, giving an incorrect impression about our corporation’s approach to climate change”

Shell, which has said it is setting its strategy for a world of tightening constraints on fossil fuel use, said in a statement: “We believe climate change is a complex societal challenge that should be addressed through sound government policy and cultural change to drive low-carbon choices for businesses and consumers, not by the courts.”

Conoco and BP declined to comment on the action.