Judge Keenan sounded skeptical in a hearing about the case last month, arguing with a lawyer for the city, Matthew Pawa, over the role of users of fossil fuels in causing climate change — including, the judge stressed, the city itself.

“I mean, aren’t the plaintiffs using the product that is being the subject of the lawsuit and haven’t they been using it and aren’t they continuing to use it?” he asked. He cited the city’s tens of thousands of police cars, sanitation trucks, fire trucks and more. “If you go out the door and over to Foley Square,” he said, “you’re going to find police cars.”

The companies did not deny in their filings that climate change is occurring or that humans are to blame, and Judge Keenan’s opinion reflected this scientific evidence. He acknowledged that “climate science clearly demonstrates that the burning of fossil fuels is the primary cause of climate change.” He also noted that the city alleged that the industry knew the risks of climate change from the 1950s onward, but “engaged in an overt public relations campaign intended to cast doubt on climate science.”

Theodore J. Boutrous, Jr., the lead lawyer for Chevron in these suits, said “Judge Keenan got it exactly right. Trying to resolve a complex, global policy issue like climate change through litigation is ‘illogical,’ and would intrude on the powers of Congress and the executive branch to address these issues as part of the democratic process.”

In addition to Chevron, the defendants in the case were BP, ConocoPhillips, Exxon Mobil and Royal Dutch Shell.

This is not the end of the line of cases. San Francisco has announced that it will appeal Judge Alsup’s decision. Other local governments around the United States have filed similar suits, and Rhode Island this month became the first state to begin litigation.

Seth Stein, a spokesman for the New York City, 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. We intend to appeal this decision and to keep fighting for New Yorkers who will bear the brunt of climate change.”