The Florida Supreme Court ruled Friday that state lawmakers can be forced to testify in redistricting cases claiming that backroom huddling with consultants and a flurry of email exchanges were part of an illegal effort to keep Republicans in command of Florida.

The 5-2 ruling by justices sided with the League of Women Voters of Florida, which disputed the stand by lawmakers that “legislative privilege” shields them from testifying in lawsuits challenging the state’s new congressional and state Senate maps.

Justice Barbara Pariente, writing for the majority, said constitutional standards approved by voters in 2010 specifically were designed to keep partisan politics out of the once-a-decade process of redrawing the state’s political boundaries.

“We conclude that there is no unbending right for legislators and legislative staff members to hide behind a broad assertion of legislative privilege to present the discovery of relevant evidence,” Pariente wrote.

Court documents in the lawsuits filed in Leon County Circuit Court show that emails were exchanged between aides to Senate President Don Gaetz, House Speaker Will Weatherford and consultants who analyzed proposed maps.

The emails also show that in 2010, Rich Heffley, a Florida Republican Party consultant advising Gaetz, then the Senate’s redistricting chairman, organized a “brainstorming” meeting at the state party headquarters in Tallahassee.

Other documents show that Sen. Andy Gardiner, R-Orlando, designated last week as Gaetz’s successor as president, and Sen. Jack Latvala, R-Clearwater, also angling for the job in the future, emailed district information to consultants for review.