WASHINGTON (Reuters) - The U.S. Supreme Court on Tuesday appeared divided along ideological lines again on whether the contentious practice of manipulating electoral district boundaries to entrench one party in power may violate the constitutional rights of voters, with Justice Brett Kavanaugh emerging as the potential deciding vote.

More than two hours of arguments in major cases from North Carolina and Maryland on the practice known as partisan gerrymandering focused on whether courts should be empowered to block electoral maps when they are drawn by state legislators expressly to give one political party a lopsided advantage.

Conservative justices, who have a 5-4 majority on the court, signaled skepticism toward judicial intervention while liberal justices seemed supportive. The ruling, due by the end of June, could impact U.S. elections for decades either by allowing federal courts to curb partisan gerrymandering or by giving state legislators a free hand to draw districts as they choose.

Kavanaugh, appointed last year by President Donald Trump, said he did not dispute that extreme partisan gerrymandering was a problem for democracy. But he wondered whether judges should be allowed to intervene when there has been “a fair amount of activity” in states to address the problem, including the creation of independent commissions to draw electoral maps rather than legislators in the interest of fairness.

In 2016, the Supreme Court ruled 5-4 to uphold Arizona’s independent redistricting commission.

The justices last year failed to deliver a definitive ruling on the legality of partisan gerrymandering. They got another chance in the cases before them on Tuesday challenging a Republican-drawn 13-district statewide U.S. House of Representatives map in North Carolina and a single Democratic-drawn House district in Maryland.

“Have we really reached the moment, even though it would be a big lift for this court to get involved, where the other actors can’t do it?” Kavanaugh asked, referring to states.

Fellow conservative Trump appointee Justice Neil Gorsuch echoed that sentiment, asking: “Why should we wade into this?”

Legislative districts are redrawn nationwide to reflect population changes after the U.S. census each decade. In most states, this redistricting is done by the party in power.

Slideshow ( 4 images )

Critics have said gerrymandering has become increasingly effective and insidious, guided by precise voter data and powerful computer software. The result in many states has been the creation of electoral districts, sometimes oddly shaped to include or exclude certain localities, that maximize one party’s chances of winning and dilute the clout of voters who support the other party.

Plaintiffs in North Carolina and Maryland said the maps were drawn to diminish their voting power, violating their constitutional rights. In both cases, lower courts ruled that the contested districts violated the Constitution’s guarantee of equal protection under the law, the right to free speech and association, or constitutional provisions governing elections.

‘YOU’RE DISCRIMINATING’

In North Carolina, Republican legislators reworked House districts in 2016 to ensure that 10 Republicans were elected to House seats, compared to just three Democrats, in a state where voters are closely divided between the two parties.

Liberal Justice Sonia Sotomayor told Paul Clement, the lawyer representing the Republican legislators: “This is what this is all about: you’re discriminating on the basis of a group’s speech and diluting their vote accordingly.”

Conservative Chief Justice John Roberts and Kavanaugh asked questions that sounded supportive of the Republican voters who challenged the Maryland district. Democrats redrew its boundaries to help a Democratic candidate defeat a Republican congressman, moving some Republican voters out of the district into a heavily Democratic neighboring district.

“You think it’s all right to retaliate against the Republicans from the district that were moved out because of how they voted?” Roberts asked Maryland’s lawyer, Steven Sullivan.

Kavanaugh said Sullivan was trying to “run away from the obvious” by downplaying the partisan intent of the Democratic map-makers. On the Maryland map, liberal Justice Elena Kagan said that “under any measure, this is excessive.”

Slideshow ( 4 images )

But Roberts also noted that state legislators have always drawn maps with partisan interests in mind.

“You’d agree that if you had a partisan-free map ... that would be the first time in history, right?” Roberts asked the Maryland voters’ lawyer, Michael Kimberly.

Gerrymandering is carried out by cramming as many like-minded voters as possible into a small number of districts while spreading the rest in other districts too thinly to form a majority.

Liberal justices spoke of the unfairness of maps that allow a party to receive far fewer seats than their statewide vote tally would indicate. They appeared to get some support from Kavanaugh, who asked repeatedly whether the Constitution could require “proportional representation” - with legislative seats gained being proportional to the statewide vote’s party breakdown - to be used when districts are drawn.

For a Reuters graphic on the North Carolina case, click tmsnrt.rs/2HC8mvU