A federal judge Monday threw out two groundbreaking lawuits brought by San Francisco and Oakland which sought to hold some of the largest oil companies liable for climate change.

The 16-page ruling by U.S. District Judge William Alsup, while touching on the ice age and how fossil fuels propelled modern day advances, he acknowledged the problem of a warming planet but said it is just too big for the courts to solve.

In the ruling, Judge Alsup said Congress and the president are best suited to address the contribution of fossil fuels to global warming, in throwing out the lawsuits that sought to hold big oil companies liable for the Earth's changing environment.

Noting that the world has also benefited significantly from oil and other fossil fuel, Judge Alsup said questions about how to balance the 'worldwide positives of the energy' against its role in global warming 'demand the expertise of our environmental agencies, our diplomats, our Executive, and at least the Senate.'

A tanker truck passing the Chevron oil refinery in California where a U.S. judge has thrown out the lawsuits that sought to hold big oil companies liable for the role of fossil fuels in the Earth's warming environment

'The problem deserves a solution on a more vast scale than can be supplied by a district judge or jury in a public nuisance case,' he said.

Alsup's ruling came in lawsuits brought by San Francisco and neighboring Oakland that accused Chevron, Exxon Mobil, ConocoPhillips, BP and Royal Dutch Shell of long knowing that fossil fuels posed serious risks to the environment, but still promoting them as environmentally responsible.

The lawsuits said the companies created a public nuisance and should pay for sea walls and other infrastructure to protect against the effects of climate change - construction that could cost billions of dollars.

John Cote, a spokesman for the San Francisco city attorney's office, said the office was reviewing the ruling and would decide its next steps 'shortly,' but the lawsuit had 'forced a public court proceeding on climate science.'

'We're pleased that the court recognized that the science of global warming is no longer in dispute,' he said.

New York City, several California counties and at least one other California city filed similar suits.

The companies said federal law controlled fossil fuel production, and Congress encouraged oil and gas development.

The harm the cities claimed was 'speculative' and part of a complex chain of events that included billions of oil and gas users and 'environmental phenomena occurring worldwide over many decades,' they said in court documents.

National Association of Manufacturers President and CEO Jay Timmons applauded the ruling in a statement. 'From the moment these baseless lawsuits were filed, we have argued that the courtroom was not the proper venue to address this global challenge,' said Timmons.

Both Shell and BP were listed as defendants in the lawsuits brought by San Francisco and Oakland, in an attempt to hold companies accountable for their potential impacts on global warming

Alsup brought in the world's leading experts on climate change at an unusual hearing in March that he said was intended to educate him about the science behind the Earth's warming.

The nearly five-hour hearing covered topics including the history of climate change research, carbon dioxide's role as a greenhouse gas, melting ice caps, rising sea levels and extreme weather.

In Monday's ruling, the judge said he accepted the 'vast scientific consensus' that the combustion of fossil fuels has contributed to global warming and rising sea levels.

But he questioned whether it would be fair to 'ignore our own responsibility in the use of fossil fuels and place the blame for global warming on those who supplied what we demanded.'