Since 2004, the Supreme Court has wrung its hands about the problem of partisan gerrymandering without actually doing anything to stop it. Last term, the justices were supposed to finally declare whether lawmakers violate the Constitution when they manipulate district lines to rig elections—only to punt on the question. Justice Anthony Kennedy, the probable swing vote in the case, then resigned, leaving the fate of gerrymandering in the hands of his successor, Justice Brett Kavanaugh.

On Tuesday, the court once again heard challenges to political redistricting. There were few surprises—the justices have been through this before—until Kavanaugh spoke up in the second hour. And while it’s far too soon for voting rights advocates to declare victory, the justice, a Maryland voter, sounded genuinely disturbed by mapmakers’ successful effort to neutralize Republican voters. If Kavanaugh sides with the liberals, the Supreme Court will, at long last, impose real constitutional limitations on this scourge to democracy.

Going into Tuesday’s arguments, the conventional wisdom was that the voting rights plaintiffs in both cases, Common Cause v. Rucho and Benisek v. Lamone, were doomed. Without Kennedy, this logic went, there just aren’t five votes to rein in gerrymandering. Justices Clarence Thomas, Samuel Alito, and Neil Gorsuch have spurned the notion that federal courts should referee redistricting. Roberts famously dismissed the evidence that lower courts have used to gauge gerrymanders as “sociological gobbledygook.” (It isn’t.) Kavanaugh’s views on gerrymandering are a mystery, but few expected him to take the step that Kennedy wouldn’t and curtail the practice. Instead, the five conservatives seemed ready to declare that partisan gerrymandering is “nonjusticiable,” meaning courts cannot regulate it because they lack “judicially manageable standards” to identify and remedy unlawful maps.

Rucho was Tuesday’s first case, a challenge to North Carolina’s congressional map. (Republicans hold a 10–3 advantage over Democrats and boasted that they gerrymandered their way to this lopsided margin.) For a while, the arguments played out familiarly: Justices Elena Kagan and Sonia Sotomayor roasted Paul Clement’s defense of the gerrymander; Alito and Gorsuch helped prop up his argument. Kavanaugh asked a few ambivalent questions. Does the Constitution require “proportional representation,” a system in which parties win seats in rough proportion to the votes cast for them? Why should the courts get involved when some states are resolving the issue by creating independent commissions? (Never mind that the Supreme Court barely upheld these commissions by a 5–4 vote and could now strike them down.)

When Maryland Solicitor General Steven M. Sullivan approached the lectern to defend his own state’s gerrymander, however, Kavanaugh grew notably more engaged. As Sullivan insisted that the shape of Maryland’s 6th District—a sprawling bricolage of rural counties and wealthy suburbs—was not “heavily influenced” by “partisan politics,” Kavanaugh looked incredulous.

Kavanaugh appeared closer than Roberts to joining Kagan’s crusade and placing limits on “really extreme” gerrymanders.

“The stated goal was 7–1,” he told Sullivan—meaning Democratic politicians declared that they wanted to create seven Democratic districts (including the sixth) and just one Republican district. “I don’t think you should run away from the obvious.” Kavanaugh then ran through the geographic absurdity of the map, reminding us all that he is a Maryland native.

(“You’ve got Easton grouped with Carroll County!”) He also challenged Sullivan’s hypocrisy, pointing out: “You start your brief by saying that you agree partisan gerrymandering poses a threat to democracy.” Presumably, then, some gerrymandering is bad—but not Maryland’s. Why not? “What should the test be” to distinguish a benign gerrymander from a malevolent one? Kavanaugh asked.

Michael Kimberly, who represents the Maryland voters challenging the 6th District, proposed one solution. He argued that today’s partisan gerrymandering is really just a high-tech form of “official retaliation for political expression.” The Supreme Court has already held that the First Amendment prohibits retaliation against state employees, government contractors, and prisoners for their political speech. This same principle should apply when legislators retaliate against voters for their association with a political party. To create its current map, Maryland shuffled hundreds of thousands of Republicans out of a district long represented by a GOP congressman, simply because of their political affiliation. The remaining Republicans then lost their ability to translate their votes into electoral success, and the district flipped Democratic. In another context, such blatant discrimination on the basis of viewpoint would be unconstitutional. Why isn’t it here?

It’s not clear whether Kavanaugh agreed with Kimberly’s theory. But he seemed to appreciate the fact that it is appealingly straightforward—and that it separates run-of-the-mill gerrymanders from the worst of the worst. As Kagan noted, once the Supreme Court starts policing redistricting, legislators will (presumably) stop bragging about how they screwed over voters who support their opponents. At that point, it will become much more difficult to divine legislators’ illicit intent to retaliate against political expression. Plaintiffs would need “to show really dramatic effects”—wildly warped districts, massively disproportionate outcomes, and so on—to infer illicit intent. The federal judiciary would not be flooded with gerrymandering lawsuits; only in rare, flagrant cases would courts find evidence sufficient to invalidate a district.

Kavanaugh did not sound entirely convinced by Kimberly or Kagan. Still, he seemed more open to the argument than Roberts, who professed angst over the constitutional harms of gerrymandering and then rejected possible solutions. It would be a mistake, though, to write off either justice’s vote: Much more so than their conservative colleagues, both recognized that political redistricting is noxiously antidemocratic. But Kavanaugh appeared closer than Roberts to joining Kagan’s crusade and placing limits on “really extreme” gerrymanders.

By the end of Tuesday’s arguments, voting rights supporters had a fair reason to be optimistic. It would not be shocking if Kavanaugh and Roberts ultimately stuck with their conservative instincts and shut the federal courthouse doors to partisan gerrymandering plaintiffs. But it is now apparent that Kavanaugh and maybe Roberts—both of whom live in gerrymandered Maryland districts—are earnestly grappling with the evils of political redistricting. If either swings left, they could ensure that the Supreme Court delivers its most important voting rights victory of the century so far.