A sharply divided Supreme Court on Monday kept in place most of a controversial Texas redistricting plan enacted by the GOP-led legislature, despite lawsuits from civil rights groups claiming it was discriminatory.

The case involved claims of racial gerrymandering -- that election maps had the effect of harming the voting rights of black and Hispanic voters.

The 5-4 decision kept in place all but one challenged district, striking down the conclusions of a special three-judge federal panel that had ruled against the state.

That judicial panel, though, initially had approved the voting maps on an interim basis, boundaries that were subsequently enacted by the state legislature. That, said Justice Samuel Alito for the conservative majority, showed a presumption of good faith.

SUPREME COURT WON'T HEAR NORTH CAROLINA DISTRICTING DISPUTE

The lower court, said Alito, "enacted, with only very small changes, plans that had been developed by the Texas court." He added, "All these facts gave the Legislature good reason to believe that the court-approved interim plans were legally sound."

But the four liberals on the high court strongly disagreed.

"The Court today goes out of its way to permit the State of Texas to use maps that the three-judge District Court unanimously found were adopted for the purpose of preserving the racial discrimination that tainted its previous maps," wrote Justice Sonia Sotomayor.

The state had objected to earlier court-imposed plans, while civil rights groups had asked the justices to resolve the extent partisan gerrymandering claims can be litigated.

The lower court had ordered two congressional districts and statehouse districts in four counties be redrawn in time for the 2018 elections, but the high court blocked that mandate last year.

Primary elections were held in March under the existing, challenged maps.

The Supreme Court did find one state district, HD90, was an "impermissible racial gerrymander."

The cases are Abbot v. Perez (17-586 and 17-626).