WASHINGTON — The Supreme Court agreed Monday to hear a potential landmark case that addresses how far lawmakers can go in choosing their voters, rather than the other way around.

Venturing into what one justice recently called the “always unsavory” process of drawing election districts for partisan advantage, the court will try to set a standard  — something it has failed to do in the past.

The case under review comes from Wisconsin, but about one-third of the maps drawn for Congress and state legislatures could be affected by the justices’ ruling. Similar cases are pending in North Carolina and Maryland.

The issue is reaching the high court at a time when both Republicans and Democrats have improved the art of drawing congressional and legislative maps to entrench themselves in office for a decade at a time. Computer software increasingly helps them create safe districts for their most conservative and liberal candidates, whose success invariably leads to more partisan gridlock in government.

“Partisan gerrymandering of this kind is worse now than at any time in recent memory,” said Paul Smith of the Campaign Legal Center, who will argue the case next fall. “The Supreme Court has the opportunity to ensure the maps in Wisconsin are drawn fairly, and further, has the opportunity to create ground rules that safeguard every citizen’s right to freely choose their representatives.”

The court recently struck down some congressional and state legislative districts in North Carolina because they used voters’ racial composition to maximize Republicans’ political advantage. The court has ruled similarly on Virginia and Alabama racial redistricting plans.

Now, however, the Wisconsin case will confront the high court with raw politics, not race. The state is one of several battlegrounds where Republicans and Democrats fought to a…