A federal judge in Virginia has extended the state’s voter registration deadline through Thursday after a severed fiber-optic cable kept voters from registering online most of Tuesday, which was supposed to have been the last day to do so.

The order by U.S. District Judge John A. Gibney Jr. allows voters to register through the Board of Elections website until 11:59 p.m. Thursday, and for them to register in person at local elections offices or other designated agencies until those offices close at 5 p.m.

Mail-in registrations must be postmarked by Thursday, state election officials said.

Gibney was ruling in response to a lawsuit filed by voter advocacy groups, which argued that Tuesday’s disruption affected thousands, with a disproportionate impact on racial and ethnic minorities and younger voters.

“You can’t go back in time to register people,” Gibney said, before granting a motion to extend the deadline.

The hearing Wednesday morning followed a chaotic day for election officials, who lost Internet service after a fiber-optic utility cable in Chesterfield County was accidentally cut during roadside work related to a utilities project.

A spokeswoman for the state’s information technologies agency said the cable was severed sometime Monday night.

The incident also shut down Internet service for most other state agencies, including the Department of Motor Vehicles and the state health department.

But before the disruption ended around 3:45 p.m. Tuesday, it was felt most by local election officials, who were unable to register voters online, check the registration status of people who arrived at early-voting sites to cast ballots, or print labels needed to mail absentee ballots ahead of the Nov. 3 election.

Turnout has been at record levels since early voting began in Virginia last month, with long lines forming so people can cast ballots in the contest between President Trump and former vice president Joe Biden well ahead of Election Day.

Lawyers for a trio of voter advocacy groups who sought the deadline extension argued that people who wait until the last day to register tend to be minorities and younger adults. Tram Nguyen, a co-executive director for the New Virginia Majority, said that claim is based on her group’s heavy focus on registering voters in communities of color, particularly just before Tuesday’s original deadline.

Gov. Ralph Northam (D), Virginia Attorney General Mark R. Herring (D) and several state lawmakers readily agreed to the deadline extension, contending that everyone who wants to vote in the Nov. 3 election, which includes a Senate seat and several tightly contested congressional races, should be allowed to do so.

The extension took effect immediately.

The state Department of Elections encouraged people to register through the citizen portal that was down most of Tuesday and to check their registration status online.

During Wednesday’s hearing, the judge gently chastised the workers who failed to take preventive measures that would have kept the fiber-optic cable safe. He also noted that Virginians who were most affected by the accident had waited until the last day to register.

“Maybe people will learn two lessons from this case,” Gibney said. “One is to call Mr. Utility, and the other is to not let things go until the last minute.”

The state’s Republican Party lauded the decision, but it also criticized Northam’s administration for allowing the problem to happen.

“Judge Gibney did the right thing by extending the registration deadline until Thursday,” the party said in a statement. “Voters should not be penalized for the latest of the Northam administration’s failures in election administration.”

Herring had a simpler message for voters who missed the Tuesday deadline:

“Register to vote now!!” he said on Twitter.