The U.S. Supreme Court on Monday revived Ohio’s contentious policy of purging infrequent voters from its registration rolls, dealing a setback to voting rights proponents who said the practice has disenfranchised thousands of registered voters.

In a 5-4 decision with the court’s conservatives in the majority, the justices overturned a lower court ruling that Ohio’s policy violated the National Voter Registration Act, a 1993 federal law that forbids removing voters from registration lists for failing to vote. The Republican-governed state argued that the policy was needed to keep voting rolls current, clearing out people who have moved away or died.

The court’s four liberal justices dissented from the decision.

Voters purged from registration rolls, represented by liberal advocacy group Demos along with the American Civil Liberties Union, sued Ohio Republican Secretary of State Jon Husted in 2016 to end the policy.

The challengers said Ohio’s policy illegally erased thousands of voters from registration rolls in 2015 alone and disproportionately impacted racial minorities and poor people who tend to back Democratic candidates.

Under Ohio’s policy, if registered voters miss voting for two years, they are sent registration confirmation notices. If they do not respond and do not vote over the following four years, they are removed from the rolls.

Republican President Donald Trump’s administration backed Ohio in the case, reversing a stance taken by Democratic former President Barack Obama’s administration against the policy.

The 6th U.S. Circuit Court of Appeals in Cincinnati in 2016 blocked Ohio’s policy, ruling that it ran afoul of the 1993 law. The state appealed to the Supreme Court.

Reporting by Andrew Chung; Editing by Will Dunham