On May 24th, the line outside of Courtroom 12 at the United States District Court in San Francisco was dense enough that two lawyers behind me worried they wouldn’t get seats. So, they jumped ahead in the line to witness the latest volley in San Francisco and Oakland’s fight against the fossil fuel industry.

The two cities are suing five major oil companies in an effort to hold them financially responsible for their role in global warming. The oil companies — Chevron, ExxonMobil, ConocoPhillips, Royal Dutch Shell, and BP — don’t deny that climate change is happening, but they do argue that they can’t be sued for it. And that’s what Thursday’s hearing in front of Judge William Alsup was about: whether the case should be dismissed.

When the doors opened a little before 8AM, the 100 or so spectators sorted themselves into wooden benches, the checkerboard of suits mostly matching the checks of the carpet: navy, charcoal, with a few strips of tan. Despite the crowds, other reporters tell me that the hearing wasn’t nearly as packed as Judge Alsup’s climate tutorial in March, where scientists did interpretive dances to mime carbon dioxide’s absorption of infrared radiation and the judge sported a science-themed tie.

The hearing began with lawyers for Royal Dutch Shell claiming that the parent company, which is headquartered in the Netherlands, can’t be sued in a California court. Lawyers for ExxonMobil, ConocoPhillips, and BP chimed in with similar arguments about jurisdiction. “I have to have live witnesses,” was what Judge Alsup had to say on the matter. “Somebody sitting down having their third latte in the Netherlands [will have to] get on an airplane, and come over here and testify.”

This lawsuit started back in September 2017, when San Francisco and Oakland sued Big Oil. The coastal cities say that global warming is already causing problems resulting from sea level rise and flooding. And it’s only going to get more expensive. Since the fossil fuel giants contributed to this “public nuisance,” the complaint says, they should chip in to help the cities prepare for the threats of a warmer future. The lawsuit doesn’t spell out how much these fossil fuel companies should pay, but it could be in the billions, according to the San Francisco City Attorney’s office.

The California cities aren’t the only ones suing fossil fuel companies. There are at least nine other cases involving communities from Washington state to New York, according to Columbia Law School’s Climate Law Blog. Between the years 2020 and 2039, one government report projects that sea level rise and more extreme storms could cost coastal communities between $4 and $6 billion in damage every year. Plus, to protect residents, cities need to build seawalls and berms, elevate roads and buildings, and secure water sources — and they don’t want taxpayers to be the only ones on the hook for that bill.

At the three hour-plus hearing on Thursday, an assorted legal team representing the oil companies — plus a lawyer from the US Department of Justice — argued that the case should be dismissed. Damage from global warming isn’t an issue that federal law should decide in the courts, the defendants claimed. Rather, they argued, it’s an issue for the US government to regulate through policy. Plus, “Congress has repeatedly authorized and encouraged oil and gas production activities,” said Theodore Boutrous, the lawyer representing Chevron. So, he added, deeming oil and gas drilling a public nuisance would “invade the prerogatives of Congress and the executive branch.”

The cities assert that the oil companies’ activities constitute a public nuisance that they can sue over. The law of nuisance is centuries old, starting as a legal claim that dealt with things like ditches inconveniently placed in front of barns. It’s now a mainstay of environmental law, targeting things like pollution from smokestacks and noxious odors.

“The law of nuisance has been around forever and it has responded to changes in mankind,” said Steve Berman, a lawyer representing the cities of San Francisco and Oakland. “What we’re asking you, your honor, is to apply this law to a new situation.” That new situation is rising sea levels caused by climate change.

Berman also referenced oil companies’ efforts to sow misinformation about the relationship between fossil fuels and global warming. That misinformation was intentional and contributed to the harm, he argued. “Together, that forms the basis for our nuisance claim,” he said. Berman pointed to lead paint cases, where companies encouraged people to use lead paint in their homes “even though they knew it was dangerous.”

From the oil companies’ point of view, they were engaged in a healthy debate about climate change. For cities, it was false advertising. “If someone is lying to the public about climate science, I could see that’s not good,” Alsup said.

At one point, the hearing took a detour into the long history of fossil fuels in the US, which the judge said spanned from the 1850s — “when they struck oil in Pennsylvania” — to today. Fossil fuels are “causing global warming, that’s a negative,” Alsup acknowledged. But he pointed out that fossil fuels had led to “large benefits” as well, including victory in World War II. To that end, he asked both sides to prepare a 10-page brief over the next week, arguing whether or not the cities’ claims required an analysis of the costs and benefits of fossil fuels.

It’s not clear which way the judge is going to rule. “He’s very thoughtful, he’s been on the bench quite a while, he’s handled some really complex cases. So he’ll take his time with his ultimate decision,” says Pat Parenteau, a professor of law at Vermont Law School. “There’s no blueprint for how to decide this case, so it’s going to take some time for the judge to sort through it.”

The judge did hint that he thought some of the legal arguments being brought before him were overkill, questioning whether it was smart for the parties to litigate “by fighting at every trench like they did in World War I.” He offered some advice, saying, “Strategically, you should ask yourself on both sides whether you are pursuing the right course for teeing these issues up for an ultimate decision.”

Historically, climate lawsuits have not enjoyed much success in court. According to Ann Carlson, a professor of environmental law at UCLA, all of the climate change cases against the oil companies during the Bush administration were dismissed before plaintiffs got a shot at discovery. “It would be pathbreaking for a court to decide that these cases could go forward,” Carlson says.

But regardless of what Judge Alsup decides, there are likely multiple appeals ahead — whichever side loses will appeal it up to the Ninth Circuit, and onwards. The final stop is the Supreme Court, Parenteau says. But for the case pending before Judge Alsup, he says, “It’s too early and too speculative to say whether the Supreme Court would ever take an appeal.”

There’s a lot more ahead for these cases, Carlson says. “And we’re just beginning.”

Sarah Jeong contributed to this report.