A federal judge on Thursday ordered Georgia officials to reopen voter registration in a suburban Atlanta congressional district ahead of a runoff in a heated special election.

U.S. District Judge Timothy Batten, who was appointed by former President George W. Bush in 2005, ruled in favor of civil rights advocacy groups who argued that Georgia violated federal law by preventing more new voter registrations before the June 20 runoff.

Georgia had set the registration deadline on March 20, 30 days before the first round of voting in April. Democrat Jon Ossoff and Republican Karen Handel, the top two vote-getters, advanced to a runoff in the conservative 6th District. Democrats still hope Ossoff, who came within 2 percentage points of outright victory in the first round, can upset Handel in a race that’s become a test of President Donald Trump’s influence.

Batten ordered the state to extend the deadline to May 21 and to allow any district resident registered by that day to cast a ballot in the runoff. He said he wouldn’t order the state to publicize the change but that he expects the Secretary of State, Georgia’s top elections official, to update his website with the new information.

Candice Broce, a spokeswoman for Secretary of State Brian Kemp, said the state will comply with the judge’s order.

Batten said in court that his Thursday order only applies to the June runoff and not to future elections.

Jill Boyd Myers, one of the people on whose behalf the lawsuit was filed, moved from Atlanta to suburban Sandy Springs in the 6th District two days after the March 20 registration cutoff. Despite having been registered to vote in Georgia since she moved here from Ohio in 2011, she said was upset to learn she wouldn’t be eligible to vote in the runoff.

“This just felt like a real prohibition of our rights as citizens,” she said after the hearing, adding that she was thrilled with the judge’s ruling.

Attorneys for the state argued that federal law allows states to determine voters’ qualifications, including registration deadlines. The state constitution defines a runoff election as a “continuation of the general election,” and allows only those eligible to vote in the initial election to cast a ballot in the runoff, attorneys wrote in court documents laying out the state’s argument.

“It’s one contest with one electorate,” state attorney Josiah Heidt told the judge.

Georgia’s attorneys also provided declarations from state and local election officials, who were concerned that a last-minute change would leave little time before the runoff to prepare.

Batten acknowledged the arguments that it would be difficult for the state to be ready in time, but said he saw nothing to show it would be impossible.

Chris Harvey, director of the state’s Division of Elections, said in a court filing that a new registration deadline would force rapid testing by the equipment vendor and the Kennesaw State University’s Center for Election Systems before early voting begins on May 30.

“An accelerated testing period furthers increases the risk of a serious mistake to the election process that might damage the integrity of the election,” Harvey wrote.

The lawsuit was filed by the Lawyers’ Committee for Civil Rights Under Law, a Washington-based advocacy group, on behalf of civil rights organizations. They argued that the state has been aware of their concerns since the end of March.

“We’re talking about taking away the right to cast a ballot in a very important election regardless of who you are,” Julie Houk, with the Lawyers’ Committee, said in court.

Kate Constantini, a spokeswoman for Handel’s campaign, views the lawsuit through a partisan lens.

“When the Democrats can’t win following the rules — rules they themselves authored and enforced — they file partisan lawsuits to change them,” Constantini said in an email. “This lawsuit should be seen for exactly what it is: A partisan attempt to change the rules for a nakedly partisan outcome.”

Ossoff, in an emailed statement, urged all voters to exercise their rights.

“Voting rights are constitutional rights,” he said. “I encourage all eligible voters to ensure that they are registered and make their voices heard on June 20th and in all elections, regardless of their party or political persuasion.”