The New Mexico Supreme Court upheld a Democratic-drawn congressional map that divvied up a conservative, oil-producing region and reshaped a swing district along the U.S. border with Mexico, in an order published Monday.

All five justices signed a shortly worded order to affirm a lower court decision that the redistricting plan enacted by Democratic state lawmakers in 2021 succeeded in substantially diluting votes of their political opponents — but that the changes fell short of “egregious” gerrymandering.

The Republican Party argued unsuccessfully that the new district boundaries would entrench Democratic officials in power, highlighting the 2022 defeat of incumbent GOP Congresswoman Yvette Herrell by Democratic U.S. Rep. Gabe Vasquez.

EXPERTS EXAMINE HOW SUPREME COURT COULD OVERHAUL VOTING RIGHTS LITIGATION IN POSSIBLE GERRYMANDERING CASE

Democratic state lawmakers argued that the 2nd District in southern New Mexico remains competitive, with just a 0.7% margin of victory in the 2022 election.

The district is one of about a dozen in the national spotlight as Republicans campaign to keep their slim U.S. House majority in 2024. Courts ruled recently in Alabama, Louisiana and Florida that Republican-led legislatures had unfairly diluted the voting power of Black residents. Legal challenges to congressional districts are also ongoing in Arkansas, Kentucky, South Carolina, Tennessee, Texas and Utah.

State Republican Party Chairman Steve Pearce said the legal outcome in New Mexico “leaned heavily on the closeness of the previous election” in which a “popular Republican incumbent” was defeated by a lesser-known rival.

“We are contemplating our next course of action,” said Pearce, who represented the 2nd District in Congress before running unsuccessfully for governor in 2018.

State District Court Judge Fred Van Soelen had ruled in October that recent changes to New Mexico’s congressional districts do not violate the state constitution.

Democrats hold every statewide elected office in New Mexico, along with its three House and two Senate seats.

SUPREME COURT RULES IN FAVOR OF BLACK VOTERS IN ALABAMA RACIAL GERRYMANDERING CASE

Though Republicans won control of the U.S. House from Democrats in the 2022 election, the closely divided chamber more accurately reflects the ratio of Republicans to Democrats among voters nationally than at any time in recent years, according to an Associated Press analysis.

New Mexico was among several states to use a citizens advisory board with the aim of tempering political inclinations — without taking redistricting powers away from state lawmakers.

Groups, including Common Cause, said the process resulted in fairer maps. But Republicans in the state’s legislative minority argued that they were effectively shut out of the final legislative process amid conversations beyond legislative hearings via email and text messages that were subpoenaed at trial.

Democrats gained a 12% advantage in voter registrations over Republicans in the newly drawn 2nd District, where major party registration previously was roughly evenly split, Judge Van Soelen noted.