North Carolina State University students wait in line to vote in the primaries March 15, 2016. (Sara D. Davis/Getty)

A federal judge Monday upheld North Carolina’s controversial new voting law, dealing a blow to critics who said the state’s rules will discourage minorities from casting ballots during this fall’s presidential election.

The voting law, passed by North Carolina’s legislature in 2013, is among the strictest in the country. It reduces the number of days of early voting, prohibits people from registering and voting on the same day, stops ballots cast in the wrong precinct from being counted, ends the practice of preregistering teenagers before they turn 18 and requires a photo ID.

Republican legislators say they added the restrictions to combat voter fraud and to preserve the integrity of the voting system.

In his 485-page opinion, U.S. District Judge Thomas D. Schroeder wrote that “North Carolina has provided legitimate state interests for its voter ID requirement and electoral system that provides registration all year long up to twenty-five days before an election, absentee voting for up to sixty days before an election, ten days of early voting at extended hours convenient for workers that includes one Sunday and two Saturdays, and Election Day voting.”

Leaders of North Carolina civil rights groups said Tuesday morning that they are immediately appealing Schroeder’s ruling to the U.S. Court of Appeals for the Fourth Circuit.

Justice Department spokeswoman Dena Iverson said Monday night, “We’re disappointed in the ruling, reviewing the decision carefully and evaluating our options.”

The Rev. William J. Barber II, president of the North Carolina State Conference of the NAACP, which sued to block the law, called it “an affront to democracy.”

“Through widespread actions, rallies, marches and protests, we have said all along that we would accept no less than unabridged access to the ballot for all eligible voters,” Barber said in a statement Monday night. “Just like those who carried on before us, we will continue our movement challenging regressive and discriminatory voter suppression tactics on behalf of African Americans, Latinos, seniors, students and all those for whom democracy has been denied.”

Before a 2013 Supreme Court decision, North Carolina would not have been able to enact the voting law without the approval of the Justice Department or a federal court. Under the Voting Rights Act of 1965, North Carolina was one of nine mostly Southern states, along with individual jurisdictions in six other states, that because of their history of discrimination were required to receive federal approval, or “pre-clearance,” before making changes in voting laws.

Within weeks of the Supreme Court’s decision in Shelby County v. Holder, which effectively nullified the part of the Voting Rights Act requiring such permissions, North Carolina passed its new law. The Justice Department and several civil rights groups sued.

The law “turns back the clock to our nation’s terrible Jim Crow past,” said Penda D. Hair, co-director of the Advancement Project, a civil rights group. “In a democracy, voting should be free, fair and accessible for all eligible voters. By specifically targeting the very measures that were most used by people of color — in addition to imposing a restrictive photo ID requirement — the legislature sought to disturb the levers of power in North Carolina, ensuring only a select few could participate in the democratic process. This fight is not over.”

Richard L. Hasen, an election-law expert at the University of California at Irvine, said Monday night that the case will almost certainly be appealed to the U.S. Court of Appeals for the 4th Circuit, “which could well reverse parts of it,” and then possibly to the Supreme Court, which could deadlock 4 to 4 and leave a 4th Circuit ruling in place.

Armenta Eaton sued the state of North Carolina over a controversial voter identification law. (Nikki Kahn/The Washington Post)

“All of those appeals will have to happen in short order,” Hasen said, “for it to affect how the 2016 elections take place under the Purcell principle,” a doctrine from a Supreme Court case, which states that courts should not issue an opinion in an election case too close to Election Day if it will cause voter confusion.