Challengers of an Ohio law that purges voters who do not participate in consecutive elections or respond to a notice from state officials seemed to face an uphill battle Wednesday at the Supreme Court.

During oral arguments, only the court’s three most liberal justices seemed convinced that Ohio’s procedure violates a federal law that forbids rescinding registration because of a person’s decision not to vote. Challengers say the law has had an outsize impact among minority voters and in the state’s urban areas.

“The essence of this case,” said Justice Sonia Sotomayor, is whether Ohio’s process is “disenfranchising disproportionately certain cities where large groups of minorities live, where large groups of homeless people live, and across the country they’re the group that votes the least.”

Sotomayor was the only justice to address the political implications of the law, but it is not coincidence the case comes from Ohio, a political battleground state. Partisan tweaks of election laws to either make it easier to vote or impose more exacting restrictions are a constant across the country. Democratic states have filed briefs supporting the challengers; Republican states have supported Ohio, indicating that if the Ohio law passes muster, more states might employ it.

And there’s another sign of the case’s political implications: After past administrations supported the law’s challengers, President Trump’s Solicitor General Noel J. Francisco switched sides and on Wednesday argued for Ohio.

Only Justices Ruth Bader Ginsburg and Elena Kagan were as critical of the Ohio law as Sotomayor. Ohio’s is the most aggressive of fewer than 10 states that use nonvoting as a trigger for beginning the process of removal from voting rolls.

Justice Anthony M. Kennedy, often the pivotal justice in voting cases, and Justice Stephen G. Breyer, usually a reliable liberal vote, sympathized with Ohio’s intent.

“The reason they’re purging them is they want to protect the voter roll from people . . . that have moved and they’re voting in the wrong district,” Kennedy said. “That’s the reason. What we’re talking about are the best tools to implement . . . that purpose.”

Breyer said Ohio and other states want precise voter rolls to make sure voters are in the correct districts and to avoid voter fraud and impersonation.

“What should the state do?” he asked.

Washington lawyer Paul M. Smith, representing two groups challenging the law, said states have a number of options available. But the federal law “says you can’t use failure to vote as the reason for purging somebody from the rolls.”

Ohio denied that is what it does. And unlike many voting cases that come before the court, Wednesday’s case centered not on grand constitutional principles but on interpreting seemingly contradictory directives of federal law.

Beyond the prohibition on removing voters because they failed to vote, the law calls on states to keep accurate rolls and allows removal when a person fails to respond to a request to confirm registration and then fails to vote in two federal elections.

Ohio sends a notice after a voter skips a single federal election cycle. If they fail to respond and do not vote in the next four years, their names are removed from the rolls.

“Nobody is removed solely by reason of their failure to vote,” Ohio State Solicitor Eric E. Murphy told the justices, adding, “They’re removed if they fail to respond to a notice and fail to vote over six years, which is more than the minimum protections.”

Smith said the process was seriously flawed. By starting the process because a person did not vote in an election, “you’re going to vastly over-purge people.” He said only 20 percent of those who receive notices return them, even though they still live at the same address and are eligible to vote.

One of the challengers, for instance, is Larry Harmon of Akron. He lived at the same address for 16 years but decided not to vote in 2009 and 2010. The state sent him a notice in 2011, which he does not remember receiving. He continued not to vote because he didn’t like his choices, and when he showed up to participate in the 2015 elections, he found he was no longer registered.

The state routinely sends out thousands of similar notices. When the U.S. Court of Appeals for the 6th Circuit said the law could not be enforced in the November 2016 elections, at least 7,500 voters participated who would have otherwise been ineligible.

Conservative Justice Samuel A. Alito Jr. appeared to think Ohio’s other protections were adequate.

“Why isn’t the best interpretation of this that one cannot be removed from the list solely because of failure to vote?” Alito asked, with the emphasis on “solely.”

Later, questioning Smith about Ohio’s procedure, Alito said: “Does it say the failure to vote is a ground for removal, or does it say that moving out of the district is a ground for removal, and failure to vote plays a part in the determination of whether a person has moved out of the district? It’s evidentiary.”

Smith said failure to vote was hardly a reason to believe someone had moved. Better, he said, to use driver’s licenses or some other database. Harmon, for instance, continued to pay property taxes on the same address.

Chief Justice John G. Roberts Jr. got Smith to concede that not voting could be a starting point in some cases. Smith said it could be evidence that a person has moved if a non-forwardable notice came back to the state, providing a reason to believe the person no longer lived at the address. But that is not Ohio’s process.

Neither Justices Clarence Thomas nor Neil M. Gorsuch, who usually vote with the other conservatives, asked questions.

Sotomayor wanted Francisco to explain the government’s change from supporting challengers when the case was heard in the appeals court, and supporting Ohio now.

“There’s a 24-year history of solicitor generals of both political parties under . . . presidents of both political parties who have taken a position contrary to yours,” Sotomayor said, adding that it “seems quite unusual that your office would change its position so dramatically.”

Francisco did not give a very succinct answer — in part because Sotomayor continued to pepper him with questions.

But he said a reexamination of the issue within the Trump administration convinced him that Congress intended states could use the failure to vote as a trigger for a broader process.

The case is Husted v. A. Philip Randolph Institute.