A panel of federal judges in Virginia has concluded that 11 state legislative districts were drawn in a way that discriminates against African Americans and must be redesigned by the end of October.

The 2-to-1 decision is a victory for Democrats in a years-long battle over the legislative lines, which were drawn after the 2010 census to give the 11 House of Delegates districts a voting population that was least 55 percent black.

“Overwhelming evidence in this case shows that, contrary to . . . constitutional mandate, the state has sorted voters into districts based on the color of their skin,” wrote Judge Barbara Milano Keenan of the U.S. District Court for the Eastern District of Virginia.

“This is an important ruling against racial gerrymandering and a victory for voting rights in Virginia,” former attorney general Eric Holder said in a statement. He leads a redistricting group that supported the challenge. “Since these maps were put in place in 2011, African Americans have had their voting power diluted and their voices diminished. That will now change.”

Republicans announced that they plan to appeal to the Supreme Court.

“It would be premature to even consider any action by the General Assembly until the Supreme Court speaks on these districts,” Virginia House Speaker M. Kirkland Cox said in a statement, citing the high court’s recent decision to overturn a lower-court ruling in a Texas redistricting case.

Republicans were in charge of the House and Democrats controlled the state Senate when the legislative districts were redrawn after the 2010 Census. Under a deal hashed out between the two chambers, the GOP was able to draw the House lines and the Democrats drew them for the Senate.

With the favorable map, Republicans saw their majority in the House swell. They held 66 seats to the Democrats’ 34 until November, when a blue wave fueled by antipathy to President Trump nearly handed control to the House Democrats. The GOP held onto the House by a 51-49 edge.

Republicans might fare even worse if the lines for the next election, scheduled for November 2019, are not drawn so favorably for the GOP.

“Politically, this puts the House of Delegates completely up in the air,” Brian Cannon, executive director of OneVirginia2021, a group that advocates for nonpartisan redistricting.

The case has already been to the Supreme Court once. The three-judge panel previously ruled that the districts were constitutional because they could be explained by reasons other than race, including compactness and protection of incumbents.

But the Supreme Court overturned that ruling, telling the judges they must look at whether race was the predominant motive.

After a second trial the panel of judges came to a different conclusion, pointing to boundary lines that were “frequently small residential roads separating predominantly white and predominantly black neighborhoods,” as well as heavily black municipalities that were divided between multiple districts.

Nonracial justifications for the lines offered at trial by a demographer who consulted on the map for Republicans were “not credible,” the judges concluded.

There was also no evidence the heavily black districts were drawn to comply with the Voting Rights Act and allow minorities to elect a candidate of their choice, the court found, although the map was supported by members of the Legislative Black Caucus at the time.