TOPSHOT - People are seen on Sixth Avenue in front of the Bryant Park, in New York City, on April 25, 2018. (Photo by HECTOR RETAMAL / AFP) (Photo credit should read HECTOR RETAMAL/AFP/Getty Images)

New York said five of the biggest oil companies — BP , Chevron , ConocoPhillips , Exxon Mobil and Royal Dutch Shell — should compensate the city for the cost of mitigating the effects of global warming.

New York is one of several cities that have filed suit against big oil companies, which the municipalities blame for adverse impacts related to global warming. Echoing the ruling to dismiss two California cases last month, the judge based his ruling in part on the view that problems associated with climate change should be tackled by Congress and the executive branch.

A federal judge on Thursday threw out a lawsuit brought by New York City against five major oil companies for their role in contributing to climate change.

U.S. District Court judge for the Southern District of New York

Climate change is a fact of life, as is not contested by Defendants. 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.

The city had argued the five companies were responsible for more than 11 percent of all industrial carbon dioxide and methane emissions since the Industrial Revolution. Attorneys for New York also alleged the companies downplayed the risks of burning fossil fuels while privately acknowledging the threat of global warming for decades.

But on Thursday, John F. Keenan, U.S. District Court judge for the Southern District of New York, granted the defendants' request to dismiss the complaint.

In his ruling, Keenan agreed with the argument made by attorneys for the companies that the case should be tossed because the city's claims arise under federal common law, which displace the city's state law claims.

The judge also ruled that the Clean Air Act displaced the city's claims. He said courts have previously determined that interstate emissions from burning fossil fuels is a "federal concern" that has been "delegated to the Executive Branch as they require a uniform, national solution."

"Climate change is a fact of life, as is not contested by Defendants. 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," Keenan wrote.

Last month, a federal judge dismissed climate change cases against oil companies brought by Oakland and San Francisco based on similar grounds.

Exxon Mobil also reiterated that view following the ruling.

"We have said all along that addressing the risks of climate change is a serious global challenge that should be addressed by policymakers and not by the courts," Scott Silvestri, a media relations manager for Exxon said in a statement.

In its own statement, ConocoPhillips said, "We are pleased that a second federal court judge has agreed that climate change is a global issue that requires global policies and solutions addressed through the U.S. legislative and executive branches, not the courts."

Lastly, Keenan concluded that the city's claims raise concerns about separation of powers and foreign policy because New York is suing two foreign companies — BP and Shell — and seeking to hold all five firms liable for worldwide greenhouse gas emissions.

"Thus, to the extent that the City seeks to hold Defendants liable for damages stemming from foreign greenhouse gas emissions, the City’s claims are barred by the presumption against extraterritoriality and the need for judicial caution in the face of 'serious foreign policy consequences,'" Keenan said, citing a 2018 District Court ruling in Virginia.