In a major blow to election reformers, the U.S. Supreme Court on Thursday rejected efforts to rein in electoral map manipulation by politicians aimed at entrenching one party in power, a practice known as partisan gerrymandering that critics have said warps democracy.

The justices, in a landmark 5-4 ruling that could reverberate through U.S. politics for years to come, ruled for the first time that federal judges do not have the authority to curb partisan gerrymandering — a decision that could embolden state lawmakers to intensify use of the practice.

The court ruled along ideological lines in the decision written by Chief Justice John Roberts, with its conservative members in the majority and liberals in dissent. The court sided with Republican lawmakers in North Carolina and Democratic legislators in Maryland who drew electoral district boundaries that were challenged by voters as so politically biased that they violated rights guaranteed by the U.S. Constitution.