A federal judge has rejected New York City’s lawsuit against fossil fuel companies over climate change. The suit brought by the city would have forced fossil fuel companies to pay for some costs of climate change. Similar cases brought by San Francisco and Oakland were thrown out last month.

The cases brought by New York, San Francisco and other governments around the country are pursuing nuisance doctrine at the state level. Those laws allow courts to hold parties responsible for actions that interfere with the use of property. The fossil fuel companies say that the federal Clean Air Act authorizes only the Environmental Protection Agency to bring lawsuits over pollution.

In the New York case, the city sued BP, Chevron ExxonMobil, ConocoPhillips and Royal Dutch Shell in January for contributing to global warming and damaging climate events through the emission of greenhouse gases. The city sought money damages, claiming it must spend billions of dollars to safeguard against flooding and other global warming hazards. The city also announced that it intended to divest fossil fuel investments from its $189 billion public pension funds over the next five years.

Judge John F. Keenan of United States District Court for the Southern District of New York ruled in a 23-page decision that state law could not be used to address the issue. He wrote that climate change must be addressed by the executive branch and Congress, not by the courts.

Theodore J. Boutrous, Jr., Chevron’s lead lawyer for the case, said, “Trying to resolve a complex, global policy issue like climate change through litigation is ‘illogical,’ and would intrude on the powers of Congress and the executive branch to address these issues as part of the democratic process.”

New York City plans to appeal the judge’s decision. Seth Stein, a spokesman for New York City Mayor Bill de Blasio, said, “The mayor believes big polluters must be held accountable for their contributions to climate change and the damage it will cause New York City. We intend to appeal this decision and to keep fighting for New Yorkers who will bear the brunt of climate change.”