(Reuters) - In a boost to the Democratic Party’s chances of winning back the U.S. Congress this year, both the U.S. Supreme Court and a Pennsylvania panel of federal judges on Monday rejected Republicans’ efforts to block the state’s new congressional district map from taking effect.

FILE PHOTO: A general view of the U.S. Supreme Court building in Washington, DC, U.S., November 15, 2016. REUTERS/Carlos Barria/File Photo

The twin rulings, which ensure November’s midterm elections in Pennsylvania will be contested using the new boundaries, were announced just 24 hours before candidates for the U.S. House of Representatives must file petitions to secure spots on ballots.

In a 5-2 vote in January along party lines, the Democratic-majority state Supreme Court ruled the Republican-controlled legislature designed the old boundaries to hurt Democratic voters, violating their constitutional rights. After the legislature did not meet a court deadline to submit a new version, the court drew its own map.

Independent political analysts have said the new map will boost Democratic chances in one-third of the state’s 18 seats, which Republicans have dominated since the old district lines took effect in 2011 despite Pennsylvania’s status as a closely divided electoral swing state.

Republicans hold 12 seats after Democrat Conor Lamb’s surprise victory last week in a special election. All told, Democrats need to flip 23 seats nationwide to capture control of the House.

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

In both cases, Republicans argued only lawmakers have the power to draw voting districts. U.S. President Donald Trump, a Republican, had urged legislators to contest the map.

The panel of three federal judges, all appointed by Republican presidents, dismissed the Harrisburg lawsuit on Monday, finding that individual lawmakers did not have standing to bring such a complaint on behalf of the entire legislature.

The U.S. Supreme Court, meanwhile, rejected the Republicans’ petition in a single-line order.

In statements, Republican legislative leaders in Pennsylvania said they were disappointed by the rulings but reiterated their belief that the state Supreme Court had usurped the legislature’s role.

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

In a statement, the organization’s president, Susan Carty, said, “This victory is an important first step toward slaying the gerrymander.”

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