A lawsuit filed by New York City against major oil companies has been dismissed. The case would have held the firms accountable for climate change caused by the carbon emissions produced from burning fossil fuels.

Specifically, the claims were brought against Chevron, BP, ConocoPhillips, Exxon Mobil and Royal Dutch Shell.

US District Judge John Keenan dismissed the charges on Thursday, primarily on the grounds that climate change is a global problem and thus too large a decision for a state court. He added that it is more the role of the federal government and foreign policy to address the issue.

In defence of his rejection he wrote that “climate change is a fact of life, as is not contested by defendants”, adding that the problems which result from global warming “are not for the judiciary to ameliorate…solutions thereto must be addressed by the two other branches of government”.

New York City is planning to appeal the decision, according to Seth Stein, spokesperson for the city’s Mayor Bill de Blasio.

In a statement, Stein 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”.

The city has said the firms have long been aware of the damaging effects of their carbon emissions, though they have continued to deny the links to global warming in an attempt to promote fossil fuels and maintain financial and business gains.

The firms accused cited numerous grounds for the case’s dismissal. One was that under the federal Clean Air Act, only the country’s Environmental Protection Agency is authorised to pursue pollution lawsuits.

This argument was supported by Judge Keenan, who said that climate change is too widespread a problem to be settled in court, adding that the charges “implicate countless foreign governments and their laws and policies”.

Chevron lawyer Theodore Boutrous applauded Keenan’s ruling, saying he “got it exactly right”.

Similarly, a statement from Shell said the decision “reaffirms our view that climate change is a complex societal challenge that requires sound governmental policy and is not an issue for the courts”, while ConocoPhillips spokesperson Daren Beaudo said climate change is “a global issue that requires global policies and solutions”.

New York City first pursued legal action against the oil companies in question in January this year, suing them on the grounds that they caused current and future damages to the city through contributing to climate change. The suit claims that together the five companies produced 11% of all global warming gases through the oil and gas products they sold over the years.

The monetary damages sought are said to be in compensation for the billions spent on safeguarding the city against hazards of global warming such as flooding. As the lawsuit states, the New York is attempting to “shift the costs of protecting the city from climate change impacts back onto the companies that have done nearly all they could to create this existential threat”.

Plans to divest fossil fuel investments from the New York’s $189bn public pension funds over the next five years have also been announced.

A similar lawsuit was filed in California last year, with the counties of Marin and San Mateo and the city of Imperial Beach collectively suing a group of fossil fuel companies over damages caused by climate change.