Texas State Capitol. (Ilana Panich-Linsman/For The Washington Post)

A panel of federal judges has ruled that Texas’s Republican-led legislature gerrymandered some of the state’s congressional districts to stunt the growing influence of minority voters.

The 2-to-1 decision — years in the making — was issued Friday night. It invalidated three congressional districts in south and west Texas and in the Austin area. Although a remedy was not prescribed, redrawing the districts will probably aid Latino and Democratic voters.

The challenge to the districts was supported by the Obama administration’s Justice Department lawyers. The dissenting judge issued an acidic attack on their work, saying they painted state officials “as a bunch of backwoods hayseed bigots.”

The congressional redistricting plan was drawn by the legislature in 2011, the same year that then-Gov. Rick Perry (R) signed a voter ID law that a federal appeals court ultimately found discriminates against minorities. A district court is now considering whether that effect was intentional.

The combination of rulings could lead to Texas being required to have election changes approved in advance by federal officials. It and other states, most of them in the South, were freed from that requirement by a Supreme Court decision in 2013.

The two judges who ruled for challengers in the redistricting case Friday said the maps and the voter ID law were enacted against a backdrop in the Austin capitol of “strong racial tension and heated debate about Latinos, Spanish-speaking people, undocumented immigrants and sanctuary cities.”

All three judges agreed that the legislature packed minorities into some districts and splintered them among others to dilute their power. But the jurists disagreed about whether that was simply partisan gerrymandering, which the Supreme Court has tolerated, or racial discrimination, which is forbidden.

U.S. District judges Xavier Rodriguez and Orlando Garcia said it was the latter. “The record indicates not just a hostility toward Democrat districts, but a hostility to minority districts, and a willingness to use race for partisan advantage,” they wrote.

Dissenting Judge Jerry E. Smith of the U.S. Court of Appeals for the 5th Circuit said previous rulings over years of litigation made the case moot. But if he were deciding the case on the merits, he wrote, “Texas redistricting in 2011 was essentially about politics, not race.”

The legal battle over the districts has raged for years, and a trial on the suit ended in August 2014. Friday’s decision featured a nearly 450-page fact-finding report and a nearly 200-page opinion. The congressional districts voided by the panel are represented by Democrat Lloyd Doggett and Republicans Will Hurd and Blake Farenthold.

Judge Smith criticized the “arrogance and condescension” of the Justice Department lawyers, who he said came to Texas on a “witch hunt.”

“It was obvious, from the start, that the DoJ attorneys viewed state officials and the legislative majority and their staffs as a bunch of backwoods hayseed bigots who bemoan the abolition of the poll tax and pine for the days of literacy tests and lynchings,” Smith wrote. “And the DoJ lawyers saw themselves as an expeditionary landing party arriving here, just in time, to rescue the state from oppression, obviously presuming that plaintiffs’ counsel were not up to the task.”

Smith was particularly incensed by one unnamed lawyer, saying she showed “disdain for these proceedings by regularly rolling her eyes at state witnesses’ answers that she did not like, and she amused herself by chewing gum while court was in session.”

The remarks were similar to those of another Texas federal judge, Andrew Hanen, who last year lambasted Justice Department lawyers for allegedly lying to him in a high-profile immigration case and threatened them with ethics training.

Conservative judges in the state may no longer have to tolerate the aggressive federal position on Texas voting changes.

Last month, under new Attorney General Jeff Sessions, the department said it was changing its long-held position that the voter ID law was intentionally written to dilute minority power.

If Texas appeals the redistricting decision, it will go directly to the Supreme Court.