WASHINGTON — Race and politics divided the Supreme Court along ideological lines Monday in two cases that could affect the way state legislatures draw election districts in the future.

The court’s more liberal justices criticized maps drawn after the 2010 Census by Republican legislatures in North Carolina and Virginia for focusing predominantly on the percentage of African Americans in various districts.

The more conservative justices mostly defended the maps, either because race did not dictate the contours of the districts or because the motivator was political advantage — something the high court has not ruled against.

After two hours of oral arguments by the same set of attorneys, it appeared the court might uphold a federal district court decision striking down the North Carolina congressional maps and send the Virginia state legislative maps approved by a separate lower court back for more work.

Several of the justices expressed frustration that unless they define clearly what is allowed and what is not, they could be left with what Justice Stephen Breyer called “a set of standards that district courts can’t apply, which will try to separate sheep from goats.”

The two cases represented a continuation of the court’s work in the area of racial gerrymandering, which Breyer lamented had not been resolved by the most recent decision he wrote for the court last year. The 5-4 ruling said when it comes to black voters in Alabama, “simply maintaining percentages in an effort to prevent retrogression … is too mechanical an approach.”

The Voting Rights Act of 1965 requires that states draw districts that enable African Americans to elect their chosen representatives, lest blacks…