Federal judges have invalidated two Texas congressional districts, one of which includes parts of San Antonio, ruling that they must be fixed by either the Legislature or a federal court.

In a unanimous decision Tuesday, a three-judge panel in San Antonio ruled that Congressional Districts 27 and 35 violate the U.S. Constitution and the federal Voting Rights Act. The judges found that Hispanic voters in Congressional District 27, represented by U.S. Rep. Blake Farenthold (R-Corpus Christi) were “intentionally deprived of their opportunity to elect a candidate of their choice.” Congressional District 35 – a Central Texas district represented by Democrat Lloyd Doggett of Austin that includes parts of San Antonio – was deemed “an impermissible racial gerrymander” because map drawers illegally used race as the predominant factor in drawing it without a compelling state interest, the judges wrote.

The 107-page ruling – the latest chapter of a six-year court battle over how Texas lawmakers drew political maps – sets up a scramble to redraw the districts in time for the 2018 elections.

The court ordered the Texas Attorney General’s Office to indicate within three business days whether the Texas Legislature would take up redistricting to fix those violations. Otherwise, the state and its legal foes will head back to court on Sept. 5 to begin re-drawing the congressional map – which could shake up other congressional races when the boundaries are changed.

Before Tuesday’s decision, the judges had already ruled the Texas Legislature sought to weaken the strength of Latino and black voters – a population more likely to choose Democrats – while drawing House and congressional districts in 2011, immediately following the 2010 U.S. Census. But the 2011 maps never actually took effect.

Amid legal wrangling over the Legislature’s maps, the court drew temporary maps ahead of the 2012 elections. Texas lawmakers in 2013 formally adopted those maps and have used them for the past three election cycles.

On Tuesday, the court ruled that the intentional discrimination behind the 2011 maps carried over into the 2013 map in places like CD-35 and CD-27, where the district boundaries were unchanged “because the Legislature engaged in no deliberative process to remove any such taint.

“The Legislature in 2013 intentionally furthered and continued the existing discrimination in the plans,” the judges wrote.

The judges sided with the state on Congressional District 23 – represented by Republican Will Hurd of Helotes – ruling that it could be left intact. That sprawling West Texas district was previously flagged as discriminatory but had been modified since then. In Tuesday’s ruling, the judges called it a “Latino opportunity district.”

The court ruled only on the current congressional map, leaving legal challenges to the state House map unanswered.

The AG’s office did not immediately respond to a request for comment.

Alexa Ura covers politics and demographics for The Texas Tribune, where she started as an intern in 2013. She previously covered health care for the Trib. While earning her journalism degree at the University...

Jim Malewitz primarily covers energy and the environment for the Tribune. Before arriving in 2013, he covered those issues for Stateline, a nonprofit news service in Washington, D.C.