The U.S. Supreme Court has mostly avoided questions about gerrymandering, the practice of drawing otherwise irrational legislative district lines to the advantage of one party or of incumbents. But on Monday, in an unexpected victory for the democratic process, the court said the Constitution allows people to fight back against gerrymandering, with the strongest of tools.

The court’s legal analysis in Arizona State Legislature vs. Arizona Independent Redistricting Commission was something of a reach. But the ruling’s practical implications are unequivocally positive. Gerrymandering deprives voters of genuine choice and encourages extreme partisanship, since many incumbents have to worry more about challenges from their flanks than from the other party. Now that the justices have given their approval, voters and courageous state leaders should work to limit or eliminate politicians’ ability to fix voting maps to their advantage.

The case rose to the court from Arizona, where voters approved a ballot measure moving redistricting authority from the legislature to an independent commission. Republican state lawmakers challenged the legality of their constituents’ choice, citing the Constitution’s elections clause: “The Times, Places and Manner of holding Elections for Senators and Representatives, shall be prescribed in each State by the Legislature thereof.”

The line would seem to bar voters from stripping the legislature of redistricting authority. But the court’s majority found that such a reading would run counter to the clause’s “history and purpose,” which was not to insulate state legislatures from popular initiatives. The court also relied on “the Constitution’s animating principle that the people themselves are the originating sources of all the powers of the government.” Chief Justice John Roberts shot back in his dissent that “no matter how concerned we may be about partisanship in redistricting, this Court has no power to gerrymander the Constitution.”

Regardless of the merits of these arguments, the upshot is that popularly approved election reforms in various states are constitutional.

Usually, we are skeptical of voter efforts to assume the functions of elected lawmakers. But gerrymandering is a special case because those who were elected through a slanted process have strong incentives to perpetuate that process. The unsurprising result is brazen electoral map manipulation, visible in the contorted districts that Republicans drew in North Carolina and Democrats drew in Maryland, to name just two of many.

In states where redistricting won’t be taken out of the legislature’s hands entirely because there is no initiative process or because such a reform is seen as too radical, more modest policies are available. Reining in gerrymandering wouldn’t solve all of the country’s problems — not even all of the problems in how it conducts elections. But reform is in the national interest.