In a decision that could tilt the congressional balance of power in a key swing state in favor of Democrats, Pennsylvania's highest court decided Monday that the state's GOP-drawn congressional districts violate its Constitution, and ordered all 18 districts redrawn in the next few weeks.

Less partisan congressional districts could give Democrats a chance this November to win back as many as half a dozen seats that had been lost to them over the past decade. It could also give the party a major boost in its quest to take back the House of Representatives, where Democrats need to net 24 seats to win control of the chamber.

“Yet another gerrymandered district map thrown out!!” tweeted Sen. Sheldon Whitehouse (D-R.I.) of the news.

"Today’s decision is a victory for democracy and another blow to the Republican Party’s nationwide effort to game the system," said Tom Perez, chairman of the Democratic National Committee, in a statement.

In a 4-to-3 decision, Pennsylvania's Supreme Court ordered the Republican-controlled state legislature to redraw the lines by Feb. 9, an extraordinarily quick timeline that will reset the districts in time for the state's May congressional primaries. Democratic Gov. Tom Wolf will have veto power over the maps.

“I strongly believe that gerrymandering is wrong and consistently have stated that the current maps are unfair to Pennsylvanians,” he said in a statement.

Meanwhile, Pennsylvania Republicans cried foul and said they would try to appeal the decision to the U.S. Supreme Court.

The state Supreme Court has a 5-to-2 Democratic majority 2015, and GOP lawmakers suggested the court ruled to benefit its own party.  "It is clear that with this ruling the Court is attempting to bypass the Constitution and the legislative process and legislate themselves, directly from the bench," said the top lawmakers in the state Senate and state House, Joe Scarnati and Jake Corman, respectively, in a joint statement.

The justices said an opinion would be released soon.

Political scientists say Pennsylvania is one of the most gerrymandered states in the nation. Since gaining control of the state legislature in time to redraw maps after the 2010 Census, Republicans have rather easily held on to 13 of 18 districts since the count, despite the fact the state split almost evenly for President Trump and Hillary Clinton.

How the court reached its decision is just as significant as what they decided. This is the second court case in recent weeks to throw out electoral lines because they were drawn to favor one party's voters over another, decisions that have mostly benefited Democrats.

Earlier this month, a federal court struck down GOP-drawn maps in North Carolina, saying Republican lawmakers violated the Constitution when they redrew many of the districts to lean so heavily in favor of Republicans. The court gave lawmakers just 2½ weeks to redraw all 13 of their congressional districts, though the U.S. Supreme Court agreed to pause that timeline, which means the GOP-drawn lines will still be in effect in November's midterms.

The U.S. Supreme Court heard a case from Wisconsin in October that challenged Republicans' drawing of state legislative maps for being overtly partisan. It will also this term hear a similar case in Maryland, one of the few Democratic-drawn maps being challenged at the moment.

“You're seeing a dam burst in the lower courts on partisan gerrymandering,” said Rick Pildes, an expert on redistricting law at New York University. “You're seeing the frustration of judges, federal and state, with how aggressive and blatant state legislatures have become … in pursuing partisan advantage seeking.”

Republicans may be victims of their own success, just by the sheer number of state legislatures they controlled after 2010, when maps were being redrawn on new census data. Republicans redrew nearly half of all congressional districts, four times as many as Democrats. And Democrats have been locked out of power in some key swing states, such as Pennsylvania, ever since.

Democrats say that getting maps redrawn is a critical step to taking back the House, which they haven't controlled since 2010. It's also not an understatement to say that Democrats' political future could be on the line for the next decade if they don't have a say in how the next decade's worth of electoral maps are redrawn after the census comes out again in 2020.

Winning governor's races is one way they had planned to put a stop to Republicans' map-drawing abilities. But litigating the maps has been surprisingly effective. When a federal court threw out Wisconsin's state House map in November 2016, it was the first time in a decade that a federal court had done so because the maps favored one party.

Democrats are also having momentum at the ballot box. They have picked up 34 state legislative seats in the Trump era. On the congressional level, Democrats are outpolling Republicans in generic ballots by a noticeably wide margin.

“Now [Republicans] have to cope with potentially losing their last security blanket — the rigged lines they drew to skew the maps and protect their incumbents,” said Jesse Ferguson, a former top official at House Democrat's campaign arm.

The Supreme Court has long been open to the idea that partisanship when drawing maps could be unconstitutional. In 1986, it said partisan gerrymandering in Illinois amounted to a constitutional violation, Pildes said. But the justices couldn't agree on an objective way to measure partisanship. How much is too much, essentially?

Monday's case wasn't the only one involving Pennsylvania's maps. A three-judge panel on a federal court recently sided with Republicans, though Pildes and other legal experts think Monday's state Supreme Court decision will be the final word.

Legal analysts also weren't sure that appealing to the Supreme Court is a possibility, given that Pennsylvania's state court ruled that the lines violated the state Constitution. The Supreme Court has never thrown out a state's redistricting plan because of extreme partisan gerrymandering.

Correction: The 1986 Supreme Court case on partisan gerrymandering was about maps drawn in Illinois, not California.