TAMPA, Fla. — In a sharply worded decision, a Florida judge ruled late Thursday that Republicans illegally redrew the state’s congressional districts, saying they “made a mockery” of an amendment meant to inject fairness into a process that has long been politically tainted.

Judge Terry P. Lewis of Florida’s Second Judicial Circuit ordered that two districts be redrawn — one, the 10th District, now held by Representative Daniel Webster, a Republican, and the other, the Fifth District, held by Representative Corrine Brown, a Democrat. In redrawing them, neighboring districts are also likely to be affected.

The state is expected to appeal. The ruling, issued less than two months before Florida’s primary, is unlikely to affect this year’s elections. But if it stands it could have broad implications for the 2016 elections.

Judge Lewis delivered a blistering, 41-page attack on Florida’s redistricting process, reserving his most scathing criticism for the Republican establishment, including political operatives. He said it was clear that Republican operatives had managed to “infiltrate and influence” the Florida Legislature.