The U.S. Supreme Court on Wednesday appeared unsure how to resolve a challenge to a state legislature redistricting plan in Alabama that packed black voters into certain districts in a way that critics say diminishes their influence at the polls.

The nine justices heard an 70-minute oral argument on two cases brought by the Alabama Democratic Conference and the Alabama Legislative Black Caucus against the redistricting by the Republican-controlled state legislature in 2012.

The case centers on the practice known as gerrymandering in which election districts are drawn in a way to provide one party an advantage in as many districts as possible while consolidating the other party's voters into as few as possible.

Democrats say Alabama, a state with a past history of erecting hurdles for black voters, violated the U.S. Constitution's guarantee of equal protection under the law by concentrating black voters, who tend to vote Democratic, into a small number of districts.

Several justices appeared sympathetic to the state in part because it had to consider race to some extent to comply with the Voting Rights Act, a federal law aimed at protecting minority voting rights.

But some also seemed to favor sending the case back to a lower court for further proceedings on the technical question of whether the plaintiffs' allegations needed to be more specific. It seems unlikely the court will throw out the redistricting plan outright.

Chief Justice John Roberts summed up the complex nature of the case when he noted that Alabama faced the difficult task of considering race in a limited way in order to comply with the Voting Rights Act while not going so far as to be accused of packing the black vote into minority districts.

The state had to aim for "the sweet spot between the two extremes," Roberts said.

A federal court upheld the new plan in a December 2013 ruling.

This is the first voting rights case to be heard by the high court since its June 2013 ruling that struck down Section 5 of the Voting Rights Act, which is the provision Alabama was bound by when coming up with its plan.

A ruling is due by the end of June.

The cases are Alabama Democratic Conference v. Alabama and Alabama Legislative Black Caucus v. Alabama, U.S. Supreme Court, No. 13-1138 and 13.895.

(Reporting by Lawrence Hurley; Editing by Will Dunham)