President Trump will most likely fill a vacancy on the Supreme Court this year. (Michael S. Williamson/The Washington Post)

The Supreme Court announced Friday it will add a second case this term to determine whether partisan gerrymandering is unconstitutional, accepting a challenge from Maryland Republicans who say the state’s dominant Democrats drew a congressional district that violated their rights.

The court already has heard a challenge from Wisconsin Democrats, who challenged a legislative redistricting drawn by the state’s Republican leaders.

The cases could reshape the way American elections are conducted. The Supreme Court has never thrown out a state’s redistricting efforts due to partisan gerrymandering, and political parties consider drawing the map one of the perks of being in charge of state government.

It is unclear why the court thought it needed another case, and it had previously declined to immediately take up the Maryland case Benisek v. Lamone.

But the new challenge raises a question of specific interest to Justice Anthony M. Kennedy, who is thought to be the pivotal vote on the issue.

Kennedy has wondered whether partisan gerrymandering retaliates against voters for their past support of a party’s candidates, which he has said could be a violation of the First Amendment.

In the Wisconsin case, Gill v. Whitford, the court was considering a different constitutional issue, equal protection. The court heard arguments in that case in early October and has not issued an opinion.

The challenge in Maryland centers on the 6th Congressional District in Western Maryland, which was redrawn to include parts of heavily Democratic Montgomery County. The plaintiffs say that in the mandatory redrawing of congressional districts after the 2010 census, the state’s Democratic leaders diluted the number of Republican voters in the district to ensure that a Democrat would win.

The plaintiffs, Republican voters who live in the district, claim the legislature and then-Gov. Martin O’Malley, a Democrat, “targeted them for vote dilution because of their past support for Republican candidates for public office, violating the First Amendment retaliation doctrine,” lawyer Michael B. Kimberly wrote in his petition to the court.

The legislature “reshuffled fully half of the district’s 720,000 residents — far more than necessary to correct the mere 10,000-person imbalance in the district’s population following the 2010 census,” the petition states.

That resulted in a more than 90,000-voter swing in favor of Democrats, and the share of registered Republicans fell from 47 percent to 33 percent.

“No other congressional district anywhere in the nation saw so large a swing in its partisan complexion following the 2010 census,” Kimberly wrote.

The incumbent, Republican Rep. Roscoe Bartlett, had won by 28 percentage points in the old district.

In 2012, Bartlett lost to Democrat John Delaney in the new district by 21 percentage points. Delaney has represented the district since then.

A three-judge panel ruled against the challengers in August. In a 2-to-1 vote, the panel said the Republican challengers didn’t prove the election results occurred just because of those redistricting changes.

The state’s lawyers pointed to the fact that Delaney was almost defeated in his reelection attempt in 2014, and Republican Larry Hogan won more than 50 percent of the vote in the district in his successful campaign for governor.

Maryland Attorney General Brian E. Frosh (D) told the Supreme Court that showed candidates make a difference in the election outcomes.

"As the three-judge court noted, if an electoral loss is not attributable to 'constitutionally suspect activity,' but 'is instead a consequence of voter choice, that is not an injury. It is democracy.' "

The Supreme Court regularly voids redistricting plans because of racial gerrymandering. Although it has indicated partisan gerrymandering can also raise constitutional problems, the court has never been able to come up with a test to gauge when normal political considerations become too much.

Kennedy has refused to close the door to challenges, though. The Maryland plaintiffs point to his comments the last time the court attempted to come up with a test, in 2004.

Kennedy said citizens have a First Amendment right not to be burdened or penalized for their past “association with a political party.”

“If a court were to find that a state did impose burdens and restrictions on groups or persons by reason of their views, there would likely be a First Amendment violation,” Kennedy wrote.

While in the Wisconsin case a three-judge panel ruled that the state’s entire legislative map be thrown out, the Maryland case involves a single congressional district.

“It does not rest upon statistical measures of partisan imbalance,” the challengers told the court. “It does not ask the court to adopt any new doctrinal frameworks or approve any new legal standards.”

The new case is Benisek v. Lamone. The Wisconsin case is Gill v. Whitford.