WASHINGTON (AP)- In a politically charged ruling, the Supreme Court dealt a huge blow Thursday to efforts to combat the drawing of electoral districts for partisan gain and put a hold on the Trump administration’s effort to add a citizenship question to the 2020 census.

On the court’s final day of decisions before a summer break, the conservative justices ruled that federal courts have no role to play in the dispute over the practice known as partisan gerrymandering. The decision could embolden political line-drawing for partisan gain when state lawmakers undertake the next round of redistricting following the 2020 census.

Voters and elected officials should be the arbiters of what is a political dispute, Chief Justice John Roberts said in his opinion for the court.

The court rejected challenges to Republican-drawn congressional districts in North Carolina and a Democratic district in Maryland.

The decision was a major blow to critics of the partisan manipulation of electoral maps that can result when one party controls redistricting.

The districting plans “are highly partisan by any measure,” Roberts said.

But he said courts are the wrong place to settle these disputes.

In dissent for the four liberals, Justice Elena Kagan wrote, “For the first time ever, this court refuses to remedy a constitutional violation because it thinks the task beyond judicial capabilities.” Kagan, in mournful tones, read a summary of her dissent in court to emphasize her disagreement.

Federal courts in five states concluded that redistricting plans put in place under one party’s control could go too far and that there were ways to identify and manage excessively partisan districts. Those courts included 15 federal judges appointed by Republican and Democratic presidents reaching back to Jimmy Carter.

But the five Republican-appointed justices decided otherwise.

The decision could be a major blow to Democratic plans to flip control of the Virginia General Assembly from the Republicans to the Democrats.  The Republicans control the legislature in Virginia by slim margins in both the House of Delegates and the Senate.  Democrats had hoped to be able to redraw district lines in a manor more to their favor but today’s ruling overrides other federal attempts change Virginia’s district boundaries.  Democrats hold the advantage in the urban areas in Northern Virginia, Richmond, Roanoke Lynchburg and parts of the Tidewater area.  Republicans largely control the rural counties.