Two Northern California counties and a Southern California coastal city on Monday sued 37 oil and natural gas and coal companies, alleging they have known for half a century that their production was contributing to climate change, including devastating impacts from coastal flooding.

The defendants, which were given 30 days to respond, include BP plc, Chevron Corp., ConocoPhillips, ExxonMobil Corp., Royal Dutch Shell plc and coal producer Peabody Energy.

San Francisco Bay Area counties Marin and San Mateo joined San Diego County’s Imperial Beach in filing separate lawsuits. Plaintiffs contend the operators created a public nuisance for almost 50 years — 1965-2015 — by hiding the fact that fossil fuel production was heating and damaging the environment.

The first-of-their-kind lawsuits claim a “coordinated, multi-front effort to conceal and deny” threats by discrediting scientific consensus about climate change and fueling doubt among the public and by regulators.

The defendants “promoted and profited from a massive increase” in fossil fuels use causing “an enormous, foreseeable and avoidable increase in global greenhouse gas pollution” that has led to “a wide range of dire climate-related effects, including global warming, rising atmospheric and ocean temperatures, ocean acidification, melting polar ice caps and glaciers, more extreme and volatile weather and sea level rise…”

For example, the lawsuits cited ExxonMobil and Chevron for developing sturdier offshore drilling platforms and planning for structures to withstand ice, which would allow for “drilling in previously unreachable Arctic areas that would become seasonally accessible.”

The plaintiffs allege that the operators “concealed the dangers, sought to undermine public support for greenhouse gas [GHG] regulations, and engaged in massive campaigns to promote the ever-increasing use of their products at ever-greater volumes.”

“Sea level rise is here and we’re experiencing it firsthand in Marin, as roadways continually flood with king tides and storms,” Marin County Supervisor Kate Sears stated.

Even without rising seas, “there is a 99% risk that the county experiences a devastating three-foot flood before the year 2050, and a 47% chance that such a flood occurs before 2030,” the Marin County lawsuit stated.

The plaintiffs are seeking restitution, punitive damages and other relief for claims of public nuisance, private nuisance, strict liability, negligence and trespass.

Citing eight causes of action, the lawsuit claims the defendants were responsible for 20.3% of the total greenhouse gas emissions between 1965 and 2015, amounting to 227.6 gigatons of carbon dioxide.

Some of the claims mirror a lawsuit filed against ExxonMobil in late 2015, alleging the Big Oil major did not disclose the impact to the environment from its oil and gas production. The multi-state action is led by New York Attorney General Eric Schneiderman.

Meanwhile, in March the Court of Appeals for the Fifth Circuit dismissed a lawsuit initially filed four years ago by the Southeast Louisiana Flood Protection Authority-East against producers and pipeline companies, claiming they were destroying coastal wetlands and contributing to flooding.

The three California lawsuits, each close to 100 pages, are nearly identical and all were filed by San Francisco law firm Sher Edling, working with San Mateo County Counsel John Beiers, Marin County Counsel Victor M. Sher, as well as Jennifer Love of McDougal, Love, Boehmer, Foley, Lyons & Canlas of La Mesa as city attorney of Ocean Beach.