Failing to vote can lead to getting knocked off voter registration rolls, a divided Supreme Court ruled Monday in a decision that likely will help Republicans and harm Democrats.

The court's conservative majority ruled 5-4 that Ohio did not violate federal laws by purging voters who don't vote and fail to return notices confirming their residency. Justice Samuel Alito wrote the majority opinion. Justice Stephen Breyer penned an 18-page dissent for the liberal wing of the court.

The ruling could be a major victory for Republicans, who tend to benefit from lower voter turnout, and a stinging loss for Democrats, who do best in high-turnout elections. That's because minorities, young people and those with lower incomes are more likely to be disenfranchised by the state's policy.

Ohio, often a bellwether in national elections, has removed thousands of people who don't vote for two years, don't return warning notices, and then don't vote for another four years. The state was sued after the 2015 election, when those who had not voted since Barack Obama was elected president in 2008 discovered they no longer were registered.

Under federal laws enacted in 1993 and 2002, states cannot remove voters from registration lists because of their failure to vote. But they can do so if voters don't respond to confirmation notices.

The question for the court was whether failing to vote could be the initial trigger leading to removal. The U.S. Court of Appeals for the 6th Circuit in 2016 said no, which restored the votes of 7,515 Ohioans.

The case was the latest in a series of battles against attempts by some states to restrict voting rights and combat alleged voter fraud. Most of the states that backed Ohio have Republican governors or legislatures; most of those opposed are governed by Democrats.

The Supreme Court has heard a bevy of voting rights cases since its controversial 2013 decision striking down a key section of the Voting Rights Act, which had forced mostly Southern states to clear changes in election laws with federal officials.

Last term, the justices nixed the excessive use of race in redistricting by legislatures in North Carolina and Virginia; a similar case from Texas is pending. This term, it faces cases from Wisconsin and Maryland challenging what opponents claim were election maps drawn by state legislators for purely partisan gain.

Several other states that use the failure to vote as a trigger in efforts to cleanse their registration rolls could be affected by the high court's decision in the Ohio case, including Georgia, Oklahoma, Pennsylvania, Tennessee and West Virginia.

But Ohio's law was considered the harshest in the nation because it kick-started the purging process after only two years. During oral argument in January, Paul Smith, the lawyer for those challenging the law, said "most of the people who are purged have not moved."

But U.S. Solicitor General Noel Francisco — whose office changed sides in the case after Trump was elected — said Ohio had the right to streamline "over-inflated" and "bloated" voter registration rolls.