WASHINGTON (AP) — The Supreme Court has ruled that state courts can act as a check on their legislatures in redistricting and other issues affecting federal elections.

The court rejected arguments by North Carolina Republicans that could have transformed contests for Congress and president.

The justices by a 6-3 vote upheld a decision by North Carolina’s top court that struck down a congressional districting plan as excessively partisan under state law.

The high court did, though, strongly suggest there are limits on what state courts can do.

Chief Justice John Roberts wrote for the court that “state courts retain the authority” to apply state constitutional restraints in federal elections.