WASHINGTON (AP) — The Supreme Court on Monday upheld Arizona congressional districts drawn by an independent commission and rejected a constitutional challenge from Republican lawmakers.

The 5-4 outcome preserves efforts in 13 states to limit partisan influence in redistricting. Most notably, California uses an independent commission to draw electoral boundaries for its largest-in-the-nation congressional delegation.

The Arizona case stemmed from voter approval of an independent commission in 2000. The legislature’s Republican leaders filed their lawsuit after the commission’s U.S. House map in 2012 produced four safe districts for Republicans, two for Democrats and made the other three seats competitive. Democrats won them all in 2012, but the Republicans recaptured one last year.

Justice Ruth Bader Ginsburg wrote for the court that there is “no constitutional barrier to a state’s empowerment of its people by embracing that form of lawmaking.”

Justice Anthony Kennedy and Ginsburg’s three liberal colleagues joined her opinion.

In dissent, Chief Justice John Roberts accused the majority of approving a “deliberate constitutional evasion.”

States are required to re-draw maps for congressional and state legislative districts to account for population changes after the once-a-decade census.

The justices have been unwilling to limit excessive partisanship in redistricting, known as gerrymandering. A gerrymander is a district that is intentionally drawn, and sometimes oddly shaped, to favor one political party.

Republicans employed an enormously successful strategy to take advantage of the 2010 census, first by winning state legislatures and then using that control to draw House districts to maximize their power. One measure of their success: In 2012, Republicans achieved a 33-seat majority in the House, even though GOP candidates as a group got 1.4 million fewer votes than their Democratic opponents.

Independent commissions such as Arizona’s “may be the only meaningful check” left to states that want to foster more competitive elections, the Obama administration said.

The argument against independent commissions rests in the Constitution’s Election Clause, which gives state legislatures the power to set “the times, places and manners of holding elections for senators and representatives.”

Only Arizona and California essentially remove the legislature from the process, the National Conference of State Legislatures said, in support of the Republican lawmakers in Arizona.

Lawmakers’ only contribution in those states is picking commission members from a list devised by others. In the other states — Connecticut, Hawaii, Idaho, Indiana, Iowa, Maine, Montana, New Jersey, New York, Ohio and Washington — lawmakers either get first crack at drawing districts, approve plans drawn by commissions or appoint commission members of their choosing, the conference said.

Supporters of the commissions point to more competitive races in both Arizona and California since the commissions were created.

The case is Arizona State Legislature v. Arizona Independent Redistricting Commission, 13-1314.