New York’s top court threw out the state’s new congressional district lines Wednesday, ruling Democrats gerrymandered them to their favor and failed to follow procedures meant to ensure the once-a-decade redistricting process was free of partisan influence.

In a split decision, the Court of Appeals cleared the way for a court-appointed special master to draw new congressional and state Senate maps, invalidating a set of Democrat-drawn districts that were first put into place earlier this year for the 2022 elections.

The ruling marked a major victory for Republicans in New York and nationally, rejecting a congressional map that would have given Democrats – who are clinging to a slim majority in the U.S. House of Representatives – an enrollment edge in 22 of the state’s 26 congressional districts.

But the decision throws New York’s election process into disarray.

The state’s primary elections are currently scheduled for June 28th. But the court acknowledged its ruling will likely require the state to push that date back – though it suggested the governor and lieutenant governor primaries may remain in place.

That sets up a possibility that some primary elections will be held in June, with the rest in August. An exact date will be determined by the state Legislature or, if lawmakers fail to act soon, a state judge.

“Although it will likely be necessary to move the congressional and senate primary elections to August, New York routinely held a bifurcated primary until recently, with some primaries occurring as late as September,” Chief Judge Janet DiFiore wrote in the court’s majority opinion.

Four of the state’s seven Court of Appeals judges agreed with the majority opinion, with Judges Michael Garcia, Madeline Singas and Anthony Cannataro siding with DiFiore. Judges Jenny Rivera, Rowan Wilson and Shirley Troutman all dissented, in whole or in part. All of the judges are Democrats aside from Garcia, who is a Republican.

The ruling comes after state Republicans sued to challenge the lines earlier this year. Democrats who control the state Legislature drew the maps in January after a new, bipartisan panel called the Independent Redistricting Commission, or IRC, failed to complete its work.

The IRC process was approved by voters in 2014 and first put into place during the current redistricting cycle, which occurs every 10 years to account for population shifts in the latest Census. The process, laid out in the state Constitution, requires the IRC to send a proposed set of congressional and state legislative district lines to the Legislature for consideration. If lawmakers reject them, the IRC is tasked with sending a second set for consideration.

But late last year, the IRC failed to come up with a second set of maps, gridlocking along party lines and finishing its work without sending lawmakers a revised proposal to consider after its first set was rejected. With the constitution silent as to what was supposed to happen next, the Democrat-led Legislature stepped in and drew the lines itself.

It ended up being a fatal mistake.

The Court of Appeals ruled the Legislature didn’t have the authority to draw the lines, tossing the congressional and state Senate districts. The court remained silent on the Assembly lines, which will be allowed to stay in large part because they weren’t included in the GOP’s original lawsuit.

The court also upheld the lower courts’ ruling that the congressional maps were skewed to benefit Democrats, who are hoping to pick up a few seats in heavily blue New York, where 19 of the state’s 27 current congressional districts are held by Democrats. (The state lost a seat in the current round of redistricting.)

The ruling marks the end of the line, leaving Democrats unable to appeal.

Republicans hailed the ruling as a victory for democracy, praising the Democrat-appointed Court of Appeals for its decision. The court also rejected the Democrats' argument that the Legislature should be given a second chance to pass lines before they're sent to a special master, dealing Republicans another win.

"Despite Democrats’ attempts to inject partisan politics into this process, New Yorkers will now get what they voted for (in 2014)," state Senate Republican Leader Rob Ortt said in a statement. "We look forward to a special master producing fair, independent maps for the people of New York."

In a statement, Mike Murphy, a spokesman for state Senate Democrats, said they are "disappointed" in the decision. Democrats had argued they did not gerrymander the maps, pointing to decisions they made to create districts that connect racial or ethnic groups. They also argued the state Senate lines were simply correcting a Republican gerrymander from 10 years ago.

Now, the task of drawing New York’s congressional and state Senate lines for the next 10 years will fall to Jonathan Cervas, a postdoctoral fellow at Carnegie Mellon University in Pittsburgh. He was appointed special master by state Acting Supreme Court Justice Patrick McAllister of Steuben County, where the Republican lawsuit was initially filed.

McAllister has given Cervas until May 24th to come up with new lines, with a hearing scheduled for May 6th.

"We will make our case to the special master appointed by the court," Murphy said in a statement.

The fate of the primary election date will likely be determined in the coming days.

Michael Li, senior counsel for the Brennan Center for Justice's Democracy Program, said either the state Legislature or McAllister will have the authority to set a new primary date, at least for congressional and state Senate races.

"The Legislature is back in session, and so it's possible the Legislature may decide to address all of this," Li said. "That would be probably the cleanest way to do this. But if they don't, Judge McAllister could order it moved. State courts do have that power."

The state Board of Elections, which administers the electoral process in New York, issued a statement Wednesday saying it is reviewing the decision. But the board's statement made clear it doesn't anticipate the gubernatorial primary moving to August, or even state Assembly primaries -- setting up the possibility that Senate and Assembly nominees will be elected on different days.

"We do not foresee the June 28th primary changing for our statewide offices, the State Assembly, Judicial Delegates and Alternates and any local offices that are scheduled to be on the primary ballot," according to the board's statement

This story was updated on Wednesday evening with new details.