Donald Trump so dominates the media landscape that he crowds out other news. So what may be the most important political development of our time—the death of partisan gerrymandering—may not be receiving the attention it deserves.

Following the 2010 census, and the Republican landslides in the midterm elections of that year, G.O.P. leaders at the state level created remarkably cynical legislative maps for both state offices and the U.S. House of Representatives. They drew district lines that gave Republicans many more seats than were justified by their over-all statewide numbers. In Pennsylvania, for instance, Republicans received only about half the statewide votes, but they now control thirteen of the eighteen seats in the House. Yet the Republicans may have overreached. A series of court decisions in recent weeks—in North Carolina, Pennsylvania, and at the United States Supreme Court—have demonstrated that the judicial branch of government is mobilizing to end this shameful and destructive legislative practice.

The legal assault began on January 9th, when, in a powerful two-hundred-and-five-page opinion by Judge James A. Wynn, Jr., a three-judge panel struck down the North Carolina congressional-district lines. What’s most important about Wynn’s opinion is that he seems to have solved the biggest problem with judicial review of gerrymandering: the standard of review. Drawing district lines will always involve some degree of political calculation, but judges have struggled with the question of how much politics is too much. What rule should judges follow to determine if a gerrymander violates the Constitution? Wynn’s test is straightforward. As Nicholas Stephanopoulos, a professor at the University of Chicago Law School, puts it, under this standard, “a district map is invalid if (1) it was enacted with the discriminatory intent of benefiting a particular party and handicapping its opponent; (2) it has produced a discriminatory effect in the form of a large and durable partisan asymmetry in favor of the mapmaking party; and (3) no legitimate justification exists for this effect.” In plain English, Wynn’s test means that if politicians draw district lines solely to protect their partisan interests, they’re invalid. (The Supreme Court put the decision on hold, but this is a routine step when the Justices are considering a similar issue.)

A comparable rationale seems to have motivated the Pennsylvania Supreme Court, earlier this week, to strike down the Republican gerrymander of the state’s district lines. In a brief order, with a full opinion to come later, the court held that Republican legislators violated the state constitution when they crafted districts that were so favorable to their party. Because the decision was based on the state constitution, as opposed to the federal, that means there is virtually no chance that the U.S. Supreme Court will overturn it. The Pennsylvania court ordered new lines to be drawn in time for the 2018 midterms, including the primaries, so Democrats, who already have a favorable political environment in the state, have a new and better chance of picking up seats there.

Still, the Supreme Court could slow or even stop the momentum against partisan gerrymandering. Last year, the Court heard arguments in a case challenging the Republican-drawn district lines in Wisconsin, and the Justices have yet to reach a decision. But, in addition to sympathetic comments by Justice Anthony Kennedy during the argument of the Wisconsin case, there is another reason for optimism. In December, the Justices agreed to hear a Republican challenge to a gerrymander by Democratic legislators in Maryland. During the oral argument of the Wisconsin case, several Justices expressed worry that they would appear unduly partisan by striking down a Republican-led effort; the chance to eliminate a Democratic initiative at the same time would satisfy the Court’s desire to appear even-handed in its application of a new standard—and would serve as a warning to all states that gerrymandering had become an out-of-control affliction across the country.

In the short term, the effect of limits on gerrymandering would be clear: since Republicans drew so many of the lines after 2010, Democrats would be helped by a revision of those districts. (Although, because Democrats are increasingly clustered in cities, there is a limit to how much they can be helped by constraints on partisan gerrymandering; even with fairer lines, Democrats will continue to win urban districts overwhelmingly and struggle elsewhere.) But partisan gerrymandering damages more than just one party’s interests. By essentially giving most seats to one party or the other, thus eliminating competitive seats, the state legislators have exacerbated the polarization and the paralysis that afflict our democracy. Legislators in safe seats, who fear only primaries, have no incentive to work with their political adversaries and reach compromises. At long last, judges appear to be telling legislators that they have gone too far with their self-protection racket—and that it’s time for voters to have some real choices once again.