The Florida legislature illegally drew the state's congressional districts to primarily benefit the Republican party, a judge has ruled, and has ordered them redrawn.

Circuit judge Terry Lewis said in a 41-page ruling Thursday that legislators relied on GOP political operatives who worked in secret to craft the final political maps adopted in 2012. In doing so Lewis rejected arguments from top legislative leaders that they had done nothing wrong during the process.

The ruling is not expected to disrupt this year's elections because the legislature is expected to appeal the decision to the state supreme court. But ultimately the changes could affect the political careers of Florida's congressional delegation, which is currently dominated by Republicans.

The landmark decision comes in the first serious test of the Fair Districts amendments adopted by the state's voters in 2010. Those standards said legislators could no longer draw up districts to favor incumbents or a political party, a practice known as "gerrymandering."

"It's a pretty historic ruling," said David King, one of the attorneys who represented the coalition of groups that sued the Legislature. "It just doesn't work to say you are open and transparent. You actually have to do it."

A spokesman for House Speaker Will Weatherford said Thursday night that the House was reviewing the decision.

Lewis's ruling followed a 12-day trial earlier this year that centered on whether legislators used a "shadow" process to conceal the role of GOP consultants who helped draw up the maps. The groups pushing the lawsuit contended this process resulted in a handful of illegally-drawn congressional districts that were aimed at boosting Republicans overall.

The judge did not agree that all the districts cited by the groups were unconstitutional. But he found that two districts violated the new standards: a sprawling district held by US congresswoman Corinne Brown that runs from Jacksonville to Orlando and a central Florida district held by congressman Dan Webster. Brown is a Democrat, while Webster is a Republican.

Lewis said the presence of two invalid districts rendered the entire congressional map invalid although he said that doesn't mean that every district must be redrawn. Lewis did not say in his ruling, however, whether the Legislature or the courts should be responsible for drawing the new districts.

Part of the evidence used by Lewis to make his decision was never presented publicly. It was kept secret because of legal challenges brought by one of the consultants involved. But Lewis said that evidence convinced him that the political operatives engaged in a "conspiracy to influence and manipulate the Legislature into a violation of its constitutional duty."

"They made a mockery of the Legislature's proclaimed transparent and open process of redistricting by doing all of this in the shadow of the process," Lewis stated in his ruling.

The evidence presented publicly included testimony that a top House aide shared maps with a Republican consultant before they were made public. Another map, which resembled one put together by a consultant, was submitted in the name of a college student who said under oath he had nothing to do with it.

Lewis also questioned why legislators deleted emails and documents related to redistricting even though they knew a lawsuit was likely.

"There was no legal duty on the part of the Legislature to preserve these records, but you have to wonder why they didn't," Lewis wrote.

Weatherford and Senate president Don Gaetz testified during the trial that outside GOP consultants were told early on that they would have no role in the process. They both denied that the Legislature deliberately drew up maps to favor Republicans. Attorneys for the Legislature repeatedly pointed out during the trial that several Republican incumbents, including Allen West, lost their re-election bids in 2012.

Attorneys and legislators at the time also called the deletion of emails routine.

Even though there are more registered Democrats in the state, Republicans currently hold a 17-to-10 majority in Florida's congressional delegation. President Barack Obama also won the state in the last two presidential elections, although Republicans have won the last four gubernatorial races.