Debris flies as the eye of Hurricane Matthew nears Daytona Beach, Fla., on Oct. 7. (Phelan Ebenhack/Reuters)

A federal judge ordered Florida to extend its voter registration deadline by six days, until Tuesday, because of Hurricane Matthew.

In the storm’s wake, many residents are still struggling to return to their homes and recover, even as they face looming deadlines to register to vote. Nowhere has the issue of voter registration been more contentious than Florida, where Republicans had refused to push back the deadline.

At a hearing Wednesday morning, U.S. District Judge Mark Walker ordered the extension. “No right is more precious than having a voice in our elections,” he said at the hearing, according to the Tampa Bay Times.

The original deadline had been this week, on Oct. 11. After Gov. Rick Scott (R) refused to move that deadline, Walker had issued an emergency order Oct. 10 to keep registration open one more day so his court could hold a hearing on the matter.

In Walker’s temporary order Monday, the judge rebuked the governor’s refusal as “irrational,” “nonsensical” and “poppycock.”

“These voters have already had their lives (and, quite possibly, their homes) turned up-side down by Hurricane Matthew,” the judge wrote. “They deserve a break, especially one that is mandated by the United States Constitution.”

[Hurricane victims face another challenge: Exercising their right to vote]

Florida is a crucial swing state, where polls have shown Democratic presidential nominee Hillary Clinton slightly ahead of Republican Donald Trump, but within the margin of error. Voting rights activists, legal experts and Democrats have accused the governor of taking political advantage of the storm to prevent residents still reeling from the hurricane from voting.

“You shouldn’t have to choose between your physical safety and your right to vote,” said Myrna Pérez, deputy director of the Brennan Center’s Democracy Program. “It’s something you would think would have bipartisan support.”

Scott, chairman of a super PAC supporting Trump’s presidential campaign, explained his decision last week before the hurricane hit, saying: “Everybody has had a lot of time to register. On top of that, we’ve got lots of opportunities to vote: early voting, absentee voting and Election Day. So I don’t intend to make any changes.”

When pressed by reporters, Scott said, “Look, this is, this is politics.”

Despite Scott’s resistance to extending registration, Trump promoted the fact that registration was being extended by at least one day — before Walker’s ruling came out today extending it even further — at a rally Tuesday night in Panama City Beach, Fla.

“Due to the hurricane, voter registration, it’s been extended. Did you hear about this? Through tomorrow, so register, you’ve got to go and register or we’ve really — you know, we’re doing something that’s incredible, it’s a movement,” Trump said. “But if we don’t win, all it is is a little asterisk in history. There’s never been anything like this. So go and register, make sure you get out and vote.”

Some Democrats were happy about the decision.

“I’m excited to see it,” said Rep. Patrick Murphy (Fla.), the Democratic candidate for Senate, whose Tuesday schedule had him trying to pump up voter registration efforts. “I was disappointed, a couple of days ago, when I saw the governor didn’t want to do it. I’m glad to see that folks will have more time, whether they’re Republican, Democratic or independent, because we need more participation. It was sickening to me to look at the primary results and see how many people didn’t turn out to vote.”

Leaders in other states hard hit by the storm have taken steps to minimize the effect on voting. In South Carolina, Gov. Nikki Haley (R) has extended the state’s registration deadline to allow paperwork to be postmarked by Tuesday.

And in Georgia, voters can register electronically, an option not available to Florida residents.

In North Carolina, where saturated rivers are forcing thousands from their homes, newly restored rules that were nearly taken away by Republicans will allow voters who miss the deadline to register during early voting.

But with many of that state’s eastern counties struggling with still-rising floodwaters, it remains unclear what effect the storm will have on polling places and displaced residents. The North Carolina State Board of Elections has said it is still trying to assess possible damage and effects.

Jenna Johnson and David Weigel contributed to this post.