The U.S. Supreme Court on Wednesday considers for the second time in recent months whether to rein in politicians who draw state electoral maps with the aim of entrenching their party in power in a case involving a Maryland congressional district.

The justices heard a similar case on Oct. 3 in which Democratic voters challenged state legislative district boundaries drawn by Republican lawmakers in Wisconsin, and have not yet issued a ruling. On Wednesday, they are set to hear an hour-long argument in a challenge by Republican voters to a U.S. House of Representatives district drawn by Maryland Democrats.

Both cases center on a practice known as partisan gerrymandering that involves manipulating boundaries of legislative districts to benefit one party and diminish another. The Supreme Court for decades has been willing to invalidate state electoral maps due to racial discrimination but never those created just for partisan advantage.

The rulings in the Maryland and Wisconsin cases, due by the end of June, could alter the U.S. political landscape, either by imposing limits on partisan gerrymandering or by allowing it even in its most extreme forms.

The Republican voters sued Maryland after the Democratic-led legislature in 2011 redrew the boundaries of the state’s Sixth District in a way that removed Republican-leaning areas and added Democratic-leaning areas. Maryland’s map led to Democrat John Delaney beating incumbent Republican Roscoe Bartlett to take the district in 2012.

At the time, Maryland also had a Democratic governor, Martin O’Malley. Current Republican Governor Larry Hogan, whose election victory in 2014 illustrated his party’s strength statewide, filed a brief backing the challengers. Republicans currently hold just one of Maryland’s eight congressional seats because of the way the electoral boundaries are drawn.

The question before the Supreme Court is whether Maryland’s electoral map violated the U.S. Constitution’s First Amendment guarantee of free speech. The novel legal theory pursued by the challengers is that Republican voters were retaliated against by Democrats based on their political views.

The Wisconsin challengers presented a different argument, that the Republican-drawn map violated the First Amendment right to freedom of expression and association and the 14th Amendment guarantee of equal protection under the law because of the extent to which it marginalized Democratic voters.

 Gerrymandered electoral maps often concentrate voters who tend to favor the minority party into a small number of districts to dilute their statewide clout and distribute the rest of those voters in other districts in numbers too small to be a majority.

Legislative districts are redrawn nationwide every decade to reflect population changes after the national census. Redistricting in most states is done by the party in power, though some states in the interest of fairness assign the task to independent commissions.

Reporting by Lawrence Hurley; Editing by Will Dunham