When it comes to damage from Hurricane Sandy, Mayor Bill de Blasio has said he knows who is responsible:

"This was a tragedy that was wrought by the actions of the fossil fuel companies. Let's be clear," he said Jan. 10.

But a hearing Wednesday showed it is not so clear whether those oil companies are legally liable.

U.S. District Judge John F. Keenan questioned the city's standing to bring the lawsuit, which seeks unspecified damages from BP, Chevron, ConocoPhillips, Exxon Mobil, and Royal Dutch Shell.

The January lawsuit came after similar litigation was filed by the cities of San Francisco, Oakland, and Santa Cruz in California.

The judge had pointed questions Wednesday, including asking the lawyer for the city if our local government bears some blame just for its huge vehicle fleet alone.

"I mean, aren't the plaintiffs using the product that is the subject of the lawsuit?" asked Keenan. "If you go out the door and go to Foley Square, you're going to find police cars!"

Theodore Boutrous, arguing for the oil companies, seized on that.

"And here, the city of New York consumes massive quantities of fossil fuels. I do think they're invested in some of these companies," the lawyer said.

The city's pension funds still invest in Big Oil, although they are seeking to sell those holdings.

The city's lawyer said he doesn't think its use of fossil fuels undermines his case.

"That's a factual issue that we'll get to at some point in the case, and the judge made an observation which is true, but it's not something that this motion is going to turn on," said attorney Matthew Pawa, who represented the city.

That motion by the energy companies seeks to dismiss the case before trial.

At issue are deep legal questions. Can companies be held liable for extracting — and not burning — fossil fuels, which leading scientists say are causing temperatures to rise? Are Congress and the White House better suited to tackle what is a global problem?

"This is a complex policy issue — to balance environmental concerns, which are important, with our energy needs, with national security — and it's just not something that courts can deal with," Boutrous said.

Oil companies are battling several similar lawsuits. So far, they have never been held liable for climate change.

"We've never won in court, but then again neither had anyone won against the tobacco companies until they did," Pawa said.

The judge said he is considering the arguments. It's unclear when he'll issue a decision about whether or not this case can proceed.