WASHINGTON — The U.S. Supreme Court ruled Monday that Texas does not have to redraw the boundaries for the state's congressional districts, a victory for Republicans and a defeat for challengers who said the lines were drawn at the expense of minority voters.

The court's 5-4 ruling ends nearly a decade's worth of legal battles over new maps for congressional and state legislative districts following the 2010 census, which gave the state four new seats in the U.S. House of Representatives because the population of Texas had grown by more than 20 percent.

A federal district court found that the state's plan was marred by racially discriminatory intent, watering down the voting power of the state's Latinos. The lower court ruled that the state failed to prove that its map did not discriminate.

But Justice Samuel Alito, joined by the Supreme Court's other conservatives, said the lower court was wrong to hold that the state had the burden to prove it was not discriminating.

"The burden of proof lies with the challenger, not the state," he wrote. The challengers, Alito continued, had the legal burden "to overcome the presumption of legislative good faith and show that the 2013 legislature acted with invidious intent" when it adjusted the boundaries in response to earlier court rulings.

Experts said Democrats would likely have gained a seat in the House if the challengers had won. Monday's ruling upheld the challenges in only one instance, declaring House District 90, in the Fort Worth area, to be an impermissible racial gerrymander.

Ken Paxton, the Texas attorney general, called the Supreme Court's decision a huge win.

"The court rightly recognized that the Constitution protects the right of Texans to draw their own legislative districts and rejected by the misguided efforts by unelected federal judges to wrest control of Texas elections from Texas voters," Paxton said.

But Justice Sonia Sotomayor, in a strongly worded dissent joined by the court's other liberals, said the ruling means that minority voters in Texas will continue to be underrepresented. "The fundamental right to vote is too precious to be disregarded in this manner," she wrote.

Anthony Gutierrez of Common Cause Texas called the ruling a severe blow to voting rights.

"It is time for Texans to take up the fight for fair maps by establishing an independent redistricting commission," he said. "In a democracy, politicians have no business choosing their voters, it is the voters who should be choosing their politicians."