By Colleen Jenkins

WINSTON-SALEM, N.C. (Reuters) - A state judge in North Carolina gave residents in counties hit hard by Hurricane Matthew five extra days to register to vote after Democrats sued to get an extension to Friday's deadline, while a federal judge ordered an extension in one Georgia county.

The Democratic Party in North Carolina challenged the state election board's refusal to extend the cutoff date, saying in its suit that thousands of people would have been deprived of their fundamental right to vote in the Nov. 8 election if Friday's deadline was not extended by at least five days.

The judge ordered an extension to next Wednesday in 36 counties, a lawyer for the state Democratic Party said on Twitter.

"This ruling will ensure that those communities who have suffered from the devastating flooding brought on by Hurricane Matthew have the grace period that they need in order to exercise their right to vote and make their voices heard in this critical election,” party officials said.

Twenty-four people have died in North Carolina and thousands have been forced from their homes in the eastern and central parts of the state due to record flooding in Matthew's aftermath.

North Carolina is a battleground state in the presidential election and could play a pivotal role in the race between Democrat Hillary Clinton and Republican Donald Trump.

State officials said this week they would not extend the regular deadline to register to vote, but allowances would be made for forms delayed by mail delivery. Those who miss the deadline can still register and vote on the same day during the statewide early voting period from Oct. 20 through Nov. 5.

The state has a Republican governor, Pat McCrory, who faces a tough contest for re-election.

The state's Republican Party opposed any extension.

"It is clear that North Carolina Democrats, who have been dominated in voter registration by Republicans, want to use a horrific natural disaster to change the rules in the middle of the game," state Republican Chairman Robin Hayes said in a statement.

In Georgia, U.S. District Judge William Moore ordered the voter registration deadline extended until Tuesday in Chatham County, which includes the city of Savannah. The judge said the administrative difficulties of doing so "pale in comparison to the physical, emotional and financial strain Chatham County residents faced in the aftermath of Hurricane Matthew."

A federal judge on Wednesday gave residents in Florida six extra days to register to vote after that state's Democratic Party sued for more time due to Matthew.

South Carolina extended its registration deadline due to Matthew from Oct. 7 to Oct. 11.

(Additional reporting by Laila Kearney and Sharon Bernstein; Editing by Chris Reese, Will Dunham and David Gregorio)