NEW YORK (Reuters) - A U.S. judge on Thursday dismissed a lawsuit by New York City seeking to hold major oil companies liable for climate change caused by carbon emissions from burning fossil fuels.

Slideshow ( 3 images )

In dismissing the city's claims against Chevron Corp CVX.N, BP Plc BP.L, ConocoPhillips COP.N, Exxon Mobil Corp XOM.N and Royal Dutch Shell Plc RDSa.L, U.S. District Judge John Keenan in Manhattan said climate change must be addressed through federal regulation and foreign policy.

“Climate change is a fact of life, as is not contested by Defendants,” he wrote. “But the serious problems caused thereby are not for the judiciary to ameliorate. Global warming and solutions thereto must be addressed by the two other branches of government.”

Seth Stein, a spokesman for New York City Mayor Bill de Blasio, said the city planned to appeal the decision.

“The mayor believes big polluters must be held accountable for their contributions to climate change and the damage it will cause New York City,” Stein said.

The city sued the oil companies in January and announced it intended to divest fossil fuel investments from its $189 billion public pension funds over the next five years.

The city said the companies knew for years that carbon emissions caused global warming, yet they promoted fossil fuels while pushing public relations efforts to discredit science on the risks of climate change. The city said it must spend billions of dollars to safeguard against flooding and other hazards of global warming, and sought money damages.

The oil companies moved to dismiss the case on numerous grounds, including that the federal Clean Air Act authorizes only the Environmental Protection Agency to bring lawsuits over pollution.

Keenan agreed with that argument on Thursday. He also said that because climate change is a global problem, the city’s claims “implicate countless foreign governments and their laws and policies,” and could not be decided by a court.

“Judge Keenan got it exactly right,” Theodore Boutrous, a lawyer for Chevron, said in a statement.

Shell, Exxon and ConocoPhillips all said they were pleased with the court ruling.

“Judge Keenan’s 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,” Shell said in a statement.

ConocoPhillips spokesman Daren Beaudo said climate change was “a global issue that requires global policies and solutions.”

BP could not immediately be reached for comment.