Coastal cities in California that are vulnerable to flooding caused by climate change are fighting back against Big Oil.

San Francisco and Oakland filed lawsuits this week demanding that ExxonMobil, Chevron (CVX), BP, ConocoPhillips (COP) and Royal Dutch Shell pay billions to cover the costs of sea walls and other protections against rising sea levels.

The aggressive strategy from the Bay Area makes San Francisco and Oakland the first major U.S. cities to attempt to shift the costs of climate change from the public to fossil fuel companies.

San Francisco and Oakland fear that billions of dollars of property in low-lying areas will be swamped by rising sea levels that scientists blame on climate change.

"These fossil fuel companies profited handsomely for decades while knowing they were putting the fate of our cities at risk," San Francisco City Attorney Dennis Herrera said in a statement announcing the lawsuits, which were filed in Superior Court in San Francisco and Alameda Counties.

In San Francisco, which is surrounded by water on three sides, at least $10 billion of public property and $39 billion of private property is at risk from rising sea levels, the lawsuit estimates. Oakland warns that rising sea levels will "disproportionately impact and endanger" low-income people and minorities, as well as the city's airport.

These concerns have been heightened by the devastating impact of Hurricanes Harvey, Irma and Maria on parts of the United States and Caribbean in recent weeks.

As CNN has reported, the consensus among scientists is that the consequences of climate change -- rising sea levels and warming oceans -- made these hurricanes worse than they would have been in the past. That's because rising sea levels make storm surges from hurricanes worse, while warming waters help intensify the storms themselves.

The San Francisco lawsuit alleges that leading oil companies for decades ignored scientists who "warned them in stark terms that fossil fuel usage would cause global warming" that poses "'catastrophic' harm."

Worse, Exxon and other oil companies have been accused of downplaying these risks to the public.

Related: Harvard study: Exxon 'misled the public' on climate change

Comparing Big Oil to tobacco companies, San Francisco and Oakland argue that oil companies engaged in an "organized campaign to deceive consumers about the dangers of massive fossil fuel production."

That argument may be strengthened by a recent Harvard study. The research found that for nearly 40 years Exxon publicly raised doubt about the dangers of climate change even as scientists inside the oil company acknowledged the growing threat. "We conclude that ExxonMobil misled the public," the peer-reviewed study said.

Exxon (XOM) has dismissed that Harvard study as "inaccurate and preposterous" and claims it was "paid for, written and published by activists."

Exxon,BP (BP) and ConocoPhillips did not provide comments in response to the California lawsuits.

Chevron, which is based in San Ramon, California, said it "welcomes serious attempts to address the issue of climate change, but these suits do not do that."

Shell (RDSA) reiterated that it has "long recognized the climate challenge." However, the company said this complex issue should be addressed through policy and cultural change, "not by the courts."

The American Petroleum Industry, a lobbying group, said in a statement that the natural gas and oil industry "will continue to play a leading role in driving down U.S. greenhouse gas and other emissions."

But some California cities fear it may be too late to avoid the consequences of climate change.