Dec. 5 (UPI) — The conservative-leaning Supreme Court on Thursday permitted Texas to use new congressional maps in the next midterm elections that were redrawn to favor the Republican Party, handing President Donald Trump a win in his litigious fight to gain an advantage to maintain control of Congress.

In a 6-3 ruling, divided along political lines, the U.S. high court said a lower district court erred when it earlier enjoined the maps’ use.

“The district court improperly inserted itself into an active primary campaign, causing much confusion and upsetting the delicate federal-state balance in elections,” the court said in the unsigned opinion.

At Trump’s urging, Texas’ legislature passed mid-decade maps that are projected to give the Republican Party five extra seats in the U.S. House of Representatives, which the GOP narrowly maintains control of.

The move has set off a gerrymandering arms race.

California has since moved to redraw its maps to neutralize the five GOP seats projected to be gained in Texas. Other states have since followed, beginning efforts to redraw their maps to favor the party in power.

Last month, a divided three-judge panel in Texas enjoined the redrawn Republican-favored maps, siding with the challengers, Texas voters and civil rights organizations — including the League of United Latin American Citizens — who argued they constituted an illegal racial gerrymander.

In its ruling Thursday, the Supreme Court said the lower court failed to give lawmakers the benefit of the doubt as to their intentions with the maps, and failed to hold against the challengers their inability to produce a viable alternative map.

“When the asserted reason for a map is political, it is critical for challengers to produce an alternative map that serves the state’s allegedly partisan aim just as well as the map the state adopted,” Justice Samuel Alito said in a concurring opinion. “Although respondents’ experts could have easily produced such a map if that were possible, they did not, giving rise to a strong inference that the state’s map was indeed based on partisanship, not race.”

In dissent, Justice Elena Kagan criticized the ruling, “based on its perusal over a holiday weekend,” to dismiss the lower court’s order, which followed months of evidence review and hearings.

“Today’s order disrespects the work of a district court that did everything one could ask to carry out its charged — that put aside every consideration except getting the issue before it right,” she said.

“And today’s order disserves the millions of Texans whom the district court found were assigned to their new districts based on their race.”

Republicans celebrated the decision, with Texas Attorney General Key Paxton, who defended the maps before the court, stating it is the state’s “fundamental right to draw a map that ensures we are represented by Republicans.”

“Texas is paving the way as we take our country back, district by district, state by state,” he said in a statement.

“This map reflects the political climate of our state and is a massive win for Texas and every conservative who is tired of watching the left try to upend the political system with bogus lawsuits.”

U.S. Attorney General Pam Bondi congratulated Texas for “advancing the rule of law.”

“Federal courts have no right to interference with a state’s decision to redraw legislative maps for partisan reasons,” she said on X.

Meanwhile, voting rights advocates and Democrats accused the Supreme Court of siding with politicians at the cost of its credibility.

“This is unacceptable,” the League of Women Voters said in a statement. “The League is outraged by the politicization of redistricting and manipulation of voters as political pawns. Allowing this map to remain in place for the next election signals a dangerous tolerance for authoritarian tactics in how political power is drawn and justified.”

Rep. Hakeem Jeffries, D-N.Y., the minority leader of the House, described the Supreme Court decision as “rubber-stamping” Texas’ “racially gerrymandered” maps.

“Republicans know the extremists can only win by cheating. The people of California and beyond will prevent that from happening,” he said on X.

In Virginia, Louise Lucas, the Democratic president pro tempore of the state’s Senate, suggested they may respond in kind.

“I got something waiting for Texas,” she said on X.

The gerrymandering arms race comes ahead of next year’s midterm elections, which historically have disfavored the president’s party. The Republicans currently hold the presidency, House and Senate.

The Republicans maintain a 220-213 majority of the House, with two vacancies.