A man walks to a voting booth March 1, 2016, at a Virginia primary election polling station at Colin Powell Elementary School, in Centreville. (Paul J. Richards/AFP/Getty Images)

A federal appeals court Tuesday upheld Virginia’s voting rules requiring residents to present photo identification to cast ballots.

The 3-to-0 ruling by the U.S. Court of Appeals for the 4th Circuit comes only months after a different panel of judges in the Richmond-based court threw out North Carolina’s far-reaching election restrictions, finding its state legislators had intentionally made it harder for minorities to vote.

In the Virginia case, the appeals court sided with attorneys for Virginia election officials who said the state’s requirement for in-person­ voting is far more flexible than election measures in other states and was not designed to discriminate.

“Not only does the substance of SB 1256 not impose an undue burden on minority voting, there was no evidence to suggest racially discriminatory intent in the law’s enactment,” the panel ruled.

Attorneys for the state Democratic Party who challenged Virginia’s law argued the photo-ID requirement was “just as bad” as North Carolina’s rules because of the disparate impact on minority voters who are less likely than white voters to have the required identification.

But the three-judge panel in the Virginia case determined that the facts of the case before them “are in no way” akin to the situation in North Carolina that their 4th Circuit colleagues ruled on.

Unlike in North Carolina, the judges said Tuesday, Virginia’s law was passed through the standard legislative process after debate, and there is no evidence it targeted African American voters.

“Today’s ruling is a victory for a common-sense law that protects the integrity of Virginia’s elections,” Virginia House Speaker William J. Howell (R-Stafford) said in a statement. He called the lawsuit “politically motivated and unnecessary.”

Attorney General Mark R. Herring (D) appointed an independent counsel, Mark F. “Thor” Hearne II, to defend the law.

The Virginia challenge was one of a set of similar voting cases throughout the country. Judges repeatedly sided with opponents of new requirements in recent months, overturning or weakening restrictive voting laws.

Virginia is “a very helpful decision,” said Michael A. Carvin, an attorney who wrote an amicus brief in support of the law. “There is obviously a concerted effort by Democrats . . . to attack photo identification laws throughout the country. I think it will have an influence on other states regarding this issue.”

Spokesman Brian Coy said Virginia Gov. Terry McAuliffe (D) continues to believe the law “is an unnecessary restriction on voting rights that disproportionately impacts minorities and elderly Virginians.”

McAuliffe “will continue to work to expand access to the ballot box for qualified voters and resist political efforts to erect new barriers to our democracy,” Coy said.

Herring declined to comment on the decision.

In 2012, Virginia lawmakers passed election rules that required voters to present identification — with or without a photo. The state mailed voter-registration cards, which could be used to cast ballots, to all registered voters.

Ten months later, the Republican-controlled legislature approved a more restrictive measure requiring photo identification for in-person voting. Voters could obtain free photo IDs from the Board of Elections and use a photo ID that had expired within the past year. A person without the required identification can cast a provisional ballot and later present a photo ID.

Both bills were signed into law by McAuliffe’s Republican predecessor, Gov. Robert F. McDonnell.

“If Virginia had required voters to present identifications without accommodating citizens who lacked them, the rule might arguably deprive some voters of an equal opportunity to vote,” the judges found. “But . . . Virginia allows everyone to vote and provides free photo IDs to persons without them.”

A federal judge in May upheld Virginia’s law, finding the state had “provided all of its citizens with an equal opportunity to participate in the electoral process” and that the voting rules are constitutional and do not violate the federal Voting Rights Act.

The three appeals judges who unanimously upheld Virginia’s law Tuesday — Dennis W. Shedd, Paul V. Niemeyer and G. Steven Agee — were nominated by Republican presidents.

Claire Gastañaga, executive director of the Virginia American Civil Liberties Union, said in a statement that the decision “discounts the reality of the hardships that voters with disabilities encounter, and ignores that many other vulnerable groups of people lack ID or the means to obtain one.”

“Whether our voter ID law is legal is of no moment; the fact is that it is wrong to enact unnecessary barriers to voting just because you can,” she added.

Bruce Spiva of the law firm Perkins Coie suggested the plaintiffs could appeal again.

“We’re disappointed in the court’s decision and are reviewing to determine our next steps in this litigation,” he said. “We remain fully committed to fighting unnecessary burdens on the right to vote in the commonwealth.”

A different 4th Circuit panel found in the North Carolina case that the state’s legislature had intentionally enacted voting restrictions to blunt the growing political power of African American voters, who turned out in record numbers for President Obama.

The North Carolina provisions “target African Americans with almost surgical precision,” Judge Diana Gribbon Motz wrote in that opinion.

An evenly divided Supreme Court in August refused to restore the state’s strict voting law.

Gregory S. Schneider contributed to this report.