The Supreme Court on Tuesday night cleared the way for Alabama to eliminate a majority-Black congressional district, a win for Republicans as they fight to hold onto their slim majority in the House.

The ruling served as the first major test since the justices in April weakened the landmark Voting Rights Act of 1965.

The practical effect of the four-page ruling, which was unsigned, is that Alabama can immediately swap out its current map, which has two majority-Black districts, for a map that has only one — giving Republicans a crucial advantage in flipping the seat back into conservative hands.

The court’s three liberal justices joined in dissent.

The conservative justices in the majority wrote that a unanimous three-judge panel that had blocked the map in late May after determining that it was racially discriminatory had “failed to follow our instruction” in light of the court’s recent Voting Rights Act ruling.

In siding with Alabama, the majority found that the lower court had improperly interfered with elected representatives as they organized an imminent election.

“States are free to decide for themselves whether last-minute changes to an election are in their best interests,” the majority wrote.

Justice Sonia Sotomayor, writing on behalf of the court’s liberal bloc, asserted that the court’s decision would lead to “a chaotic election, held under a never-before-used congressional map that intentionally discriminates against Black Alabamians.”

She added she believed the decision “debases the democratic process” and “corrodes the rule of law by rewarding Alabama’s gamesmanship and outright defiance of court orders.”

With the order, the court’s majority also sent a message for how it will view discrimination claims going forward, even those vetted by lower court judges.

The justices rejected a finding by three federal judges, including two appointed by President Trump, that there was evidence the map had been drawn intentionally to discriminate. The majority wrote that the lower court’s analysis had “departed” from the Supreme Court’s recent Voting Rights Act decision.

The ruling underscores how much more difficult it will be for groups and individuals to prove that legislative maps discriminate on the basis of race going forward. Just three years ago, the Supreme Court rejected a map in Alabama with a similar configuration, including only one majority-Black district, that it has now accepted.

“Now we know: Today is the day the SCOTUS took the remaining life out of the VRA,” said Kareem Crayton, a vice president of the Brennan Center for Justice, a think tank focused on democracy and voting rights, on social media.

Primary elections for races other than Congress were held last month in Alabama. But Gov. Kay Ivey, a Republican, delayed primaries in four congressional districts until Aug. 11, hoping for a favorable ruling from the Supreme Court in the meantime. The four districts include two that are now held by white Republicans, as well as two districts held by Black Democrats.

Those districts will change under the new map.

“Today’s decision is a win for the people of Alabama and our elections,” Ms. Ivey said in a statement. “Alabama is doing our part to keep America strong, and I am proud our state continues to fight the fight to ensure activists do not get the final say.”

Got a news tip about the courts? If you have information to share about the Supreme Court or other federal courts, please contact us.

By now, the fight over Alabama’s congressional district map is a familiar one for the Supreme Court. In a state with a fraught history of segregation and institutional racism, the courts have been involved for years in ordering Alabama officials to comply with landmark voting and civil rights laws.

It was a 1992 lawsuit that forced the creation of what had been Alabama’s lone majority-Black district, the Seventh Congressional District. But after the 2020 census, groups of Black voters challenged the state’s refusal to create a second majority-Black district, noting that more than one in four residents of Alabama are Black.

Those voters argued that state officials ran afoul of the Voting Rights Act by maintaining six majority-white districts and one majority-Black district, failing to ensure that minority groups have an opportunity to select candidates of their choice.

In June 2023, the Supreme Court agreed, striking down the map in a 5 to 4 decision and finding that state lawmakers had diluted the power of Black voters. Even after that decision, Alabama lawmakers adopted a district map that had only one majority-Black district, defying orders from a lower federal court to create a second majority-Black district or something “close to it.”

At that point, a federal court ordered a special master to independently draw a new map. The map the special master put forward included a second district with a significant percentage of Black voters, paving the way for the election of Representative Shomari Figures, a Black Democrat, in 2024. He joined Representative Terri A. Sewell, also a Black Democrat, in Congress, marking the first time in the state’s history that two Black lawmakers had served Alabama in the House at the same time.

“We deserve a fair shot at electing officials, regardless of party, who understand our lives and our goals, and are responsive to our concerns,” said one coalition of voters who joined the lawsuit, led by Evan Milligan, in a joint statement. They added they would continue to fight for a “fair map.”

A Republican challenge to this map was pending before the Supreme Court when the court issued its landmark Voting Rights Act decision in April.

In that case, Louisiana v. Callais, the justices split along ideological lines and struck down Louisiana’s voting map, finding that state lawmakers had violated the Constitution by enacting a map that created a second majority-Black district.

In the decision, Justice Samuel A. Alito Jr. laid out a new, stricter standard to bring legal challenges under the Voting Rights Act, explaining the majority had determined it was time to “update the framework” for bringing claims under the law. He cited “vast social change” across the country, particularly in the South, since the 1960s.

From now on, Justice Alito said, challengers would have to show strong evidence that maps had been drawn to intentionally discriminate on the basis of race and not just to achieve partisan advantage. Previously, a challenger had to merely show that using the map would have discriminatory effects, but not that it had been drawn with that intent.

That ruling started a new wave of redistricting, adding to an ongoing gerrymandering war launched by President Trump in Texas as he and Republicans sought to redraw maps to try to keep control of the House.

Both Tennessee and Louisiana approved maps that eliminated majority-Black districts in response. Other Southern states — like South Carolina and Georgia — decided not to enact new maps before the 2026 midterm elections but signaled an appetite for changing their district lines before the end of the decade.

In Alabama, rather than draw a new map, officials tried to use the 2023 map that had been previously blocked by the courts. In May, they asked the Supreme Court to direct the lower courts to revisit that decision in light of Justice Alito’s ruling.

Next came a surprise: When a panel of three federal judges re-examined the state’s map through the prism of the Supreme Court’s April decision, it unanimously agreed to block the map again.

In a 79-page decision issued on May 26, the panel, which included two judges appointed by Mr. Trump, wrote that it had carefully re-examined the evidence and again concluded that the map would be discriminatory. The judges said they could not “see our way clear to requiring Alabamians to cast their votes in the 2026 elections under a districting plan tainted by intentional race-based discrimination.”

The judges added that they were “painfully aware of the gravity of our ruling.” But, they added, “we do not find the issue particularly complex or close.”

Republican leaders then asked the Supreme Court to weigh in and clear the way for their preferred map, arguing that they were under time pressure as they prepared for the elections.

The challengers, including civil rights groups and Democratic state politicians, urged the court to reject the Republican state lawmakers’ request, asserting that overturning the lower court’s finding would allow Alabama to “replace a lawful plan with an unlawful and unconstitutional one” in a move that “would create chaos.”

They also said that it was too late to make changes to the map before the election.

Ann E. Marimow contributed reporting.