PHOENIX — A federal court refused Tuesday to disturb the lines for the state’s 30 legislative districts even if they were designed in part to favor Democrats.

In a 55-page opinion, the three-judge panel acknowledged that some of the lines drawn by the Independent Redistricting Commission created districts that were larger or smaller in population than others. And they said the evidence shows that “partisanship played some role in the design of the map.”

But the court ruled that the Fourteenth Amendment to U.S. Constitution does not require that legislative districts have precisely equal population. Instead, the judge said, there can be “divergencies” that are necessary to achieve other goals.

And in this case, they said, that the commission’s decision to manipulate the lines was “primarily a result of good-faith efforts to comply with the Voting Rights Act” and its prohibitions against diluting minority voting strength, and not primarily to give Democrats a political leg-up.

Tuesday’s ruling is a major setback for Republican interests who charged that the five-member commission purposely crafted the districts in a way to improve the chances of Democrats getting elected to the Legislature. Absent U.S. Supreme Court action, that likely leaves the current lines in place through the 2020 election.

But the three federal judges who wrote the unsigned ruling — Richard Clifton of the 9th Circuit Court of Appeals and U.S. District Court Judges Roslyn Silver and Neil Wake — also told challengers they may have another legal option.

They stressed that their ruling deals only with the question of whether districts of unequal population violate the U.S. Constitution.

They sidestepped questions of whether the commission violated provisions of the 2000 voter-approved law giving it the power to draw political lines. And one of those provisions requires districts of equal size.

That, the federal judges said, needs to be decided in state court.

David Cantelme, who represents the challengers, said both an appeal to the U.S. Supreme Court and a new challenge in state court are being explored.

Central to the legal fight is that question of population.

The 2000 voter-approved constitutional amendment took away the Legislature’s power to draw its own districts — as well as congressional lines — and gave it to the commission.

It requires commissioners to create districts that respect communities of interest, use county boundaries when possible, create as many politically competitive districts as possible and have districts of equal size.

Using 2010 census figures, each district should have about 213,000 residents. But the commission, by its own admission, had districts ranging from 203,026 to 220,157.

What’s worse, Cantelme charged, is many of those adjustments were made for political purposes.

In essence, he said, the commission “packed” Republican voters into some districts which already had GOP majorities. That left underpopulated districts where Democrats had a better chance of winning.

If nothing else, Cantelme said the unequal districts violate the Fourteenth Amendment which requires state legislative districts be apportioned on a population basis.

There is some evidence the maps helped increase Democrat representation.

There are currently 13 Democrats in the 30-member Senate and 24 Democrats out of 60 House members. That compares with just nine Senate Democrats and 20 in the House prior to redistricting. But Democrats have had larger numbers in some prior years.

The three-judge panel said Cantelme’s arguments about politics had some merit.

“The commissioners were aware of the political consequences of redistricting,” they wrote. “And we find that some of the commissioners were motivated in part in some of the linedrawing decisions by a desire to improve Democratic prospects in the affected districts.”

But the judges noted that the commissioners also were required, both by federal law and a specific mandate in the 2000 state initiative, to comply with the 1964 Voting Rights Act. That forbids changes in state voting laws that dilute minority voting strength, including reducing the number of districts where minorities have a chance of electing someone of their own choice.

More to the point, the judges said Cantelme did not prove to them that the political motives were paramount in the final maps. And that, they concluded, makes the maps legal, at least under the U.S. Constitution.

“The Fourteenth Amendment gives states some degree of leeway in drawing their own legislative districts,” they wrote. “And because compliance with federal voting rights law was the predominant reason for the deviations, we conclude that no federal constitutional violation occurred.”