A federal appeals court on April 1 rejected New York City’s effort to hold five major oil companies liable to help pay the costs of addressing harm caused by global warming.

Ruling in favor of BP Plc, Chevron Corp., ConocoPhillips Co., Exxon Mobil Corp. and Royal Dutch Shell Plc, the 2nd U.S. Circuit Court of Appeals in Manhattan said the regulation of greenhouse gas emissions should be addressed under federal law and international treaties.

It rejected the city’s efforts to sue under state nuisance law for damages caused by the companies’ “admittedly legal” production and sale of fossil fuels, and said the city’s federal common law claims were displaced by the federal Clean Air Act.

“Global warming presents a uniquely international problem of national concern,” Circuit Judge Richard Sullivan wrote for a three-judge panel. “It is therefore not well-suited to the application of state law.”

Sullivan added that while the Clean Air Act did not address emissions from outside the country, foreign policy concerns and the risk of courts “stepping on the toes of the political branches” barred the city’s lawsuit.

Nick Paolucci, a spokesman for the city’s law department, said the city was disappointed it could not hold the oil companies “accountable for the environmental damage they knew their products would cause.”

The April 1 decision “explains in clear detail why the U.S. climate tort lawsuits are meritless,” Chevron General Counsel Hewitt Pate said. “Working with the new U.S. administration, other governments, and other honest stakeholders on constructive global solutions is a better path.”

Other defendants did not immediately respond to requests for comment.

The decision upheld a July 2018 dismissal by U.S. District Judge John Keenan in Manhattan.

New York City’s lawsuit was an early effort among U.S. states and municipalities to turn to the judiciary invoke state law to address climate change.

The appeals court decision “confirms the wisdom of filing state common law lawsuits in state courts that are unlikely to be controlled by federal law,” said Robert Percival, a University of Maryland law professor.

In January, two New York City public pension funds voted to divest $4 billion in fossil fuel investments.

The case is City of New York v Chevron Corp et al, 2nd U.S. Circuit Court of Appeals, No. 18-2188.