The 443-page ruling by the San Antonio-based district was the latest in a complicated case that dates back to 2011, and comes just two election cycles away from the next U.S. Census — when the state would draw a new map under normal circumstances.

In 2013, the district court found evidence that lawmakers intentionally discriminated when redrawing the boundaries. But the U.S. Supreme Court soon complicated the case when it struck down a key section of the Voting Rights Act that had forced Texas to seek permission before making changes to election procedures.

But that didn’t end the legal battle, and the U.S. Department of Justice and other plaintiffs asked the court to revisit the case.

In its decision Friday, the court still found that “mapdrawers acted with an impermissible intent to dilute minority voting strength or otherwise violated the Fourteenth Amendment” of the Constitution.

"The Court finds that this evidence persuasively demonstrates that mapdrawers intentionally packed [concentrated certain populations] and cracked [diluted certain populations] on the basis of race (using race as a proxy for voting behavior) with the intent to dilute minority voting strength," U.S. District Judges Orlando Garcia and Xavier Rodriguez wrote in the majority opinion.

In a dissenting opinion, Judge Jerry Smith of the U.S. Fifth Circuit Court of Appeals sharply criticized the Justice Department.

"The Department of Justice has overplayed its hand and, in the process, has lost credibility," Smith wrote. "The wound is self-inflicted. The grand theory on which its intervention was mainly based—that invidious racial motives infect and predominate in the drawing of the 2011 district lines—has crashed and burned. I respectfully dissent from the refusal to dismiss for want of jurisdiction."

The majority’s ruling loosened the case from a lengthy limbo; The judges had dithered after hearing arguments in 2014.

Texas Democrats quickly rejoiced in the decision late Friday night.

“Tonight is a victory for the voting rights of all Texans, Gilberto Hinojosa, the state party chair, said in a statement.

The 194-page majority opinion, signed by U.S. District Judges Orlando Garcia and Xavier Rodriguez, and the dissent, from Jerry Smith, of the 5th U.S. Circuit Court of Appeals, is below.