Correction: An earlier version of this story incorrectly described payments to one of the key witnesses in the case. The witness, Pat Bainter, was paid for work he did for state Senate candidates.

A redistricting battle that has gripped Florida for more than a year could force Republican leaders to redraw the state’s political boundaries just months ahead of the midterm elections.

Several of the state’s Republican-drawn congressional districts – which one political scientist described as the most skewed he has ever studied – have come under attack by voting rights groups that allege the maps unfairly favor GOP candidates.

That coalition, led by the League of Women’s Voters, has argued that Republican legislators and staffers collaborated with political consultants to create the maps, which were approved by Gov. Rick Scott in 2011.

The case is being heard now in Leon County Circuit Court after the League filed a lawsuit alleging that the districts violate Florida’s “Fair Districts” law, which was approved by more than 60 percent of voters in 2010. If the lawsuit succeeds, the borders will have to be redrawn before the midterm elections this fall.

The trial is a culmination of a years-long battle over Florida’s political map, bringing in more than 30 current and former legislators as potential witnesses. Florida is one of the few states to apply rules to its congressional redistricting process, said Michael McDonald, a professor of politics at George Mason University and a senior fellow at the nonpartisan Brookings Institute.

McDonald said it has the potential to reshape redistricting decisions across the country, as well as the party balance in the state legislature.

“If it rules in favor of the plaintiffs, you’re talking about a potential four-seat swing to Democrats. That’s probably not enough for majority but it would make things more uncomfortable for Republicans,” he said.

Republican lawmakers have defended their redistricting effort, denying any partisan advantage although GOP consultants said they had been given access to the maps ahead of the public release.

The relationship between top party leaders and operatives was heavily scrutinized as multiple testimonies this week revealed frequent private meetings, deleted emails and more than 500 pages of internal documents about redistricting.

The maps had been put in place for the 2012 election, which saw Republicans keep control of the House though candidates received 1.4 million fewer votes overall than their Democratic counterparts.

Some of the nation’s leading social scientists testified this week that the boundaries of Florida’s districts were far more partisan than would be statistically likely.

“In this case, they did a really good job of following the recipe about how to do a partisan gerrymander,” California Institute of Technology statistics professor Jonathan Katz said Tuesday.

He found that even if there were equal numbers of Republicans and Democrats who turned out to vote, Republicans would win 58 percent of seats. The boundary issues were the most apparent in the state’s most pivotal districts, he said, adding that the maps were the most lopsided he had ever examined.

Hours later, Stanford political scientist Jonathan Rodden, who was also paid to analyze the maps for the trial, said it was “virtually impossible” that the maps were crafted with the intent of creating equally competitive districts.

While McDonald said he believes there is enough evidence of partisan mapping, he said the “smoking gun” is a map that Republican consultants drew but the legislature chose not to use – one that would have given Democrats the edge.

The map, which McDonald called “damning evidence” of partisan gerrymandering, showed that the Republicans knew that a more competitive map was possible.

But the use of that map – along with more than 500 other Republican party documents – has been a crucial question in the trial.

The GOP has fought aggressively to keep the materials off-limits in court. The State Supreme Court intervened Wednesday, ruling that the documents can be admitted as evidence, though in a closed courtroom.

One of the key witnesses, Pat Bainter, who was paid $6.2 million for consulting work for state Republican candidates, filed an emergency appeal of the ruling shortly after, but Leon County Circuit Judge Terry Lewis booted the public out of the courtroom Thursday to allow the trial to proceed with the documents admitted.

Florida’s redistricting process coincided with a $30 million party-led effort to help Republican-dominated legislatures redraw political boundaries called the Majority Redistricting Project.

The effort, which was called REDMAP by the Republican State Leadership Committee, poured millions of dollars into local races to influence the one-in-a-decade process.

Florida-based redistricting consultant David Heller, who was not part of the trial, said partisan politics come into play every time a state redraws its boundaries, regardless of the party.

“Redistricting is the most political process there is. To believe that any legislation is going to completely take politics out, is naive. It’s never going to happen,” Heller said.