The U.S. Supreme Court supported Texas’s redistricting maps on Monday. (Ricky Carioti/The Washington Post)

The Supreme Court on Monday largely upheld Texas congressional and legislative maps that a lower court said discriminated against black and Hispanic voters.

The lower court was wrong in how it considered the challenges, and did not credit the Texas legislature with a presumption of good faith, Justice Samuel A. Alito Jr. wrote in the 5-to-4 decision. The majority sided with the challengers over one legislative district.

The decision concluded a legal battle that has raged for much of a decade. The practical impact is that the 2018 and 2020 elections will be held in districts that challengers from the very beginning said were gerrymandered to blunt the impact of the state’s growing Hispanic population.

A three-judge panel in Texas last summer said two congressional districts and a handful of legislative districts were unconstitutional and called on the governor to convene the legislature to draw new lines.

Before that could happen, Texas went to the Supreme Court. In September, the justices — in the same lineup as in Monday’s decision — put that order on hold until they could hear the case.

Alito noted the legislature had adopted district lines drawn by federal judges in 2012 in an earlier iteration of the legal battle.

“And it was the plaintiffs’ burden to overcome the presumption of legislative good faith and show that the 2013 Legislature acted with invidious intent,” Alito wrote.

He said they failed. “When all the relevant evidence in the record is taken into account, it is plainly insufficient to prove that the 2013 Legislature acted in bad faith and engaged in intentional discrimination,” he wrote.

Alito was joined in the outcome by the court’s most consistent conservatives — Chief Justice John G. Roberts Jr. and Justices Anthony M. Kennedy, Clarence Thomas and Neil M. Gorsuch.

Thomas and Gorsuch would have gone even farther. Gorsuch joined Thomas in what the more senior justice said was his long-held view that the Voting Rights Act does not apply to redistricting.

Justice Sonia Sotomayor wrote a dissent that was longer than Alito’s majority decision. She said the decision “does great damage to the right of equal opportunity. Not because it denies the existence of that right, but because it refuses its enforcement.”

She added: “Texas is guaranteed continued use of much of its discriminatory maps . . . After years of litigation and undeniable proof of intentional discrimination, minority voters in Texas — despite constituting a majority of the population within the state — will continue to be underrepresented in the political process.”

After the 2010 census, Texas was awarded four new congressional districts because of the state’s population growth. Almost all of the growth came from an increase in black and Hispanic residents, but the new maps produced by the legislature fulfilled its goal of protecting Anglo Republicans, the challengers charged.

The maps were found by the district court to probably be unconstitutional, and the judges drew interim maps to be used in the 2012 elections.

The outcomes, though, were much the same. In 2013, the Republican legislature voted to permanently adopt those judicially drawn maps.

Texas argued it could not be a racial gerrymander when using the lines drawn by the neutral judges.

The judges themselves said the lines were supposed to be only temporary and redrawn after their use in one election.

The Texas case was one of three gerrymandering cases considered by the court this term and the only one involving charges of racial gerrymandering.

The case is Abbott v Perez.