A federal judge has granted a brief extension of Virginia's voter-registration deadline after heavy demand prevented some voters from registering online.

U.S. Senior Judge Claude Hilton ordered officials to reopen voter registration in the commonwealth immediately on Thursday and keep it open until 11:59 p.m. Friday.

State election officials actually had agreed to an even longer extension with the voter-advocacy group that filed the lawsuit. The agreement would have extended the deadline through Oct. 24.

But Hilton said he wanted an extension just long enough to make up for computer glitches that occurred in the hours leading up to the original Oct. 17 deadline.

While he said an extension was appropriate to make up for the time lost during the failures of the online system, "I don't think it should be used to extend beyond the period prescribed by the legislature.''

A voter advocacy group, the New Virginia Majority Education Fund, sued state officials this week seeking the extension. State officials expressed a willingness to extend the deadline, but said a judge's order was necessary to do so.

It is unclear how many potential voters were unable to register. Elections officials said they successfully processed thousands of registrations on Oct. 17, but an unknown number were able to get through because of unprecedented demand, in part because of social media postings reminding people of the looming deadline.

Gov. Terry McAuliffe issued a statement after Thursday's hearing, saying that elections officials "have been working overtime since Monday night to expand the capacity of the system that allows Virginians to register to vote online, and I am confident that the steps we have taken will provide an improved experience to people who use it.''

House Republicans blamed the McAuliffe Administration for ignoring warnings that the online registration system was working improperly.

"It is clear that local election registrars and the General Assembly have lost confidence in the Department of Elections and its ability to provide the necessary technical and support services,'' the state House Republican leadership said in a joint statement.

John Freedman, one of the lawyers for the voter-advocacy group, said at Thursday's hearing that one of the reasons they wanted a later deadline was to spread out demand on the online system to try to prevent the glitches that occurred leading up to the original deadline. Hilton said it was premature to assume there would be another computer problem, and that if it occurs, another extension could be granted.

Virginia elections commissioner Edgardo Cortes, who attended Thursday's hearing, said the department will work to notify voters of the extension. He also said voters can register online or by mail. Mail-in registrations will be accepted as long as they have a Friday postmark.

"Hopefully there will be people who can take advantage of this,'' he said.

The ruling comes a day after judges in North Carolina and Georgia rejected requests to extend the deadlines for early in-person voting and voter registration, respectively.