Two years ago, Pennsylvania’s supreme court dealt a blow to state Republicans when it said they had unconstitutionally rigged congressional elections in the state. Republicans fumed and threatened to impeach four of the justices, but the map was redrawn, and voters elected an even split of Democrats and Republicans to Congress in 2018. Now, Republicans are weaponizing a new tactic – a move that seems designed to increase their power on the state’s highest court.

The Republican proposal overhauls the way that court justices are elected in a state that can swing both red and blue. The justices on the court, where Democrats hold a 5-2 majority, are currently appointed through statewide elections, but the new plan would make it so the justices are elected from districts throughout the state. The change would probably hurt Democratic candidates – four of the current justices are from the Pittsburgh area and one is from Philadelphia, both urban areas that tend to skew blue.

If the proposal is successful, it could offer a roadmap for Republicans elsewhere to undermine state courts. That’s significant after last year’s supreme court decision that determined federal courts couldn’t stop gerrymandering – the partisan redistricting of state maps – but that nothing stopped state courts from acting. State courts responded swiftly: a state court in North Carolina followed Pennsylvania and struck down electoral districts as unconstitutional gerrymanders there. And a slew of gerrymandering lawsuits are expected when districts are next redrawn in 2021.

“With the Pennsylvania supreme court having struck down the general assembly’s gerrymandering, the general assembly is now clearly trying to gerrymander the Pennsylvania supreme court itself,” said Daniel Jacobson, an attorney who helped represent the plaintiffs in the gerrymandering case. “It only goes to show the lengths that the general assembly leaders will go when they feel that their grip on power is threatened.”

The Republican effort also comes as state lawmakers across the country have moved to weaken the independence of state courts, said Douglas Keith, who studies courts across the country at the Brennan Center for Justice. Some states do elect supreme court justices by districts and there can be good reasons for doing so, Keith said. But, unjustified efforts to change the composition of state courts can weaken public confidence in judges.

“If the calls for geographic diversity are just a thin veil on an effort to make the court more political, or capture more seats for a political party or ideology, then there’s a problem and a misunderstanding of what judges’ responsibility in our democracy are,” Keith said.

The office of Representative Russ Diamond, the measure’s main sponsor in the House, did not return a request for comment. He has previously said the change would ensure there was more “geographic” and “ideological” diversity on the court.

The change would require a constitutional amendment that voters in Pennsylvania need to approve through a ballot referendum. Before it goes to the ballot, it needs to pass the state legislature in two consecutive sessions, so the earliest it could appear is 2021. The measure has already passed the Pennsylvania state house and is being considered in the Senate.