The U.S. Supreme Court and a Pennsylvania panel of federal judges on Monday both rejected efforts of Republicans to block Pennsylvania’s new congressional district map from taking effect.

The legal battle began last year with a lawsuit from the League of Women Voters, echoing critics who had held up Pennsylvania’s weirdly shaped district as a prime example of partisan gerrymandering, in which one party engineers lines to marginalize opposing voters.

The state’s Republican legislature had asked the U.S. Supreme Court to block the map, while eight Republican Congress members and two state lawmakers separately filed a federal lawsuit in Harrisburg, Pennsylvania, seeking the same remedy.

In both cases, Republicans maintain that only lawmakers have the power to draw voting districts.  However, the panel of three federal judges, all appointed by Republican candidates, dismissed the Harrisburg lawsuit, finding that the individual lawmakers did not have standing to bring such a complaint on behalf of the entire legislature.

The twin rulings seems to ensure November’s’ midterm elections in Pennsylvania will be contested using the new boundaries.  In a 5-to-2 vote in January, the Supreme Court ruled that the Republican-controlled legislature designed the old boundaries to hurt Democratic voters, violating their constitutional rights.  The Supreme Court drew its own map after the Pennsylvanian legislature did not meet a court deadline to submit a new version of the map.

Political analysts have said the new map will boast Democratic chances in one-third of the state’s 18 seats. Republican hold 12 seats after Democratic Conor Lamb’s surprise victory last week in a special election.  Democrats would need to flip 23 seats nationwide to take control of the House.

The U.S. Supreme Court is weighing whether to set a legal standard for partisan gerrymandering in two cases from Wisconsin and Maryland.  A ruling on those cases is expected in June.