The Supreme Court is taking up its second big partisan redistricting case of the term amid signs the justices could place limits on drawing maps for political gain.

The justices are hearing arguments Wednesday in an appeal filed by Republicans in Maryland. They complain that Democrats who controlled the state government in 2011 drew a congressional district for the express purpose of ousting the Republican incumbent and replacing him with a Democrat.

In Wisconsin, Democrats are challenging legislative districts drawn by Republicans statewide. Those districts gave Republicans a huge majority in a state that otherwise is closely divided between the parties.

Get Breaking News Delivered to Your Inbox

The Supreme Court has never struck down districts for being too partisan.

A decision in favor of opponents of partisan gerrymandering could cut into the political power of the dominant party in states in which one party controls the state government.

The court is expected to issue decisions in both cases by late June.

Maryland's 6th Congressional District had been centered in rural, Republican-leaning northwestern Maryland and had elected a Republican to Congress for 20 years. Incumbent Rep. Roscoe Bartlett won re-election in 2010 by 28 percentage points.

But in the 2011 redistricting, Democrats altered the district to take in some Democratic suburbs of Washington, D.C. The new district had 62,000 fewer Republicans and 33,000 more Democrats. Bartlett lost the 2012 election by 21 percentage points.

Republican voters who sued over the changes said the state violated their First Amendment rights.

Maryland Attorney General Brian Frosh, a Democrat, is defending the district as competitive for both parties. Frosh said the district has elected a moderate Democrat, and in 2014, a friendlier year for Republican candidates, the victory margin of Democratic Rep. John Delaney dropped to less than 2 percentage points, though it rose again in 2016.

Republican Gov. Larry Hogan is siding with the voters who sued, saying partisan gerrymandering results "in real and concrete harms to our democratic republic." Hogan has proposed a nonpartisan redistricting commission.

Over the past 16 months, courts struck down political districting plans drawn by Republicans in North Carolina, Pennsylvania and Wisconsin. Federal judges threw out a state legislative map in Wisconsin and a congressional plan in North Carolina. In Pennsylvania, the state Supreme Court invalidated the state's congressional districts and replaced them with a court-drawn plan.

The Supreme Court has put the drawing of new maps on hold in North Carolina and Wisconsin, but refused to block the Pennsylvania court's adoption of revised congressional districts for this year's elections.