The U.S. Supreme Court has upheld Ohio’s process for purging voters from its rolls, siding with the state on the question of whether its policy for maintaining its voter registration lists violated federal laws.

The court split 5-4 along ideological lines in its decision, and Justice Samuel Alito wrote the majority opinion. Justice Anthony Kennedy, the court’s swing vote, sided with the conservatives in the case.

With its decision Monday, the court reversed a ruling from the 6th U.S. Circuit Court of Appeals.

[Also read: The 6 blockbuster cases to watch as the Supreme Court term ends]

The court said Ohio can remove voters from its rolls if, after skipping a federal election cycle, they do not return a notice sent by the state in the mail and fail to vote for another four years. Several other states have similar processes in place, though none are as aggressive as Ohio's.

In evaluating whether the state’s process violated the Help America Vote Act of 2002 — one of two federal laws raised in the case — Alito wrote that Ohio’s process “does not strike any registrant solely” because they failed to vote. Rather, “as expressly permitted by federal law, it removes registrants only when they have failed to vote and have failed to respond to a change-of-residence notice.”

He said the court's role is only to assess whether Ohio is violating the law, and not whether Ohio's practice could be improved.

“The dissents have a policy disagreement, not just with Ohio, but with Congress. But this case presents a question of statutory interpretation, not a question of policy. We have no authority to second-guess Congress or to decide whether Ohio’s Supplemental Process is the ideal method for keeping its voting rolls up to date. The only question before us is whether it violates federal law. It does not,” Alito wrote for the majority.

In her dissent, Justice Sonia Sotomayor said the court's ruling ignored the history of the enactment of National Voter Registration Act of 1993, the second federal law that was raised, and upholds a program that appears to disenfranchise minority and low-income voters.

She also said the majority was "distorting the statutory text to arrive at a conclusion that not only is contrary to the plain language of the NVRA, but also contradicts the essential purposes of the statute."

"Ohio's Supplemental Process reflects precisely the type of purge system that the NVRA was designed to prevent," Sotomayor wrote.

The case centered on the legality of the Buckeye State’s maintenance of its voter registration list. The state sends voters who have been inactive for two years a confirmation notice requiring a response. If the state doesn’t receive a response and the voter is inactive for another four years, Ohio removes the voter from the rolls.

Two federal laws — the National Voter Registration Act of 1993 and Help America Vote Act of 2002 — prohibit states from removing names from its voter registration rolls because a person hasn’t voted.

Civil rights groups challenged Ohio’s process for clearing its voter rolls on the basis it violated part of the National Voter Registration Act and the Help America Vote Act.

The 6th U.S. Circuit Court of Appeals ruled in favor of the civil rights groups and said Ohio violated federal voting law because the state used a voter’s failure to vote as a “trigger” that prompted the notice to be sent out.

Ohio Secretary of State Jon Husted petitioned the Supreme Court to review the lower court’s ruling and said it’s “’far from clear’ which of the combinations of programs for maintaining the rolls best balances accuracy against cost” incurred by the state.

Husted praised the Supreme Court's decision and said other states can look to Ohio's method when developing measures aimed at maintaining voter registration lists.

“Today’s decision is a victory for election integrity, and a defeat for those who use the federal court system to make election law across the country," he said. "This decision is validation of Ohio’s efforts to clean up the voter rolls and now with the blessing nation’s highest court, it can serve as a model for other states to use.”

The case drew added significance in the wake of the 2016 election, after which President Trump called into question the integrity of the election when he claimed 3 to 5 million illegal immigrants voted.

Following Trump's election, the Justice Department sided with the state of Ohio, switching its position in the case.