TAMPA, Fla. (Reuters) - Florida election officials on Thursday ordered a hand recount of ballots in the closely fought U.S. Senate race between Democratic incumbent Bill Nelson and his Republican challenger, Governor Rick Scott, after a machine recount showed them divided by a razor-thin margin.

But in another tight contest, Republican Ron DeSantis appeared to secure the Florida governor’s seat against Democrat Andrew Gillum when the electronic recount showed DeSantis with an 0.41 percentage point lead, outside the threshold to trigger further recount.

Under state law, the Florida Department of State must trigger a manual recount if an electronic recount of ballots finds a margin of victory less than 0.25 percent.

Gillum, who initially conceded on election night but then reversed course, signaled that he had not yet given up.

“A vote denied is justice denied — the State of Florida must count every legally cast vote,” Gillum said in a statement after the machine recount concluded.

In the Senate race, Nelson trailed Scott by about 12,600 votes, or 0.15 percent of the more than 8 million ballots cast following an electronic recount of ballots in the Nov. 6 election, the state said.

The electronic recount suffered glitches as liberal-leaning Palm Beach County failed to complete the process by Thursday’s deadline due to machine problems. Nelson’s team said it had filed a lawsuit seeking a hand recount of all ballots in the county.

In the next stage of the recount, Florida counties face a deadline of noon E.T. on Sunday to submit their election results - including a manual recount of undervotes or overvotes, cases where the machine that reviewed the ballot concluded a voter had skipped a contest or marked more than one selection.

If the voter’s intentions are clear on review by a person, the ballot could be counted.

Overall control of the U.S. Senate is not at stake in the Florida race. President Donald Trump’s fellow Republicans held their majority in the chamber while Democrats took a majority in the House of Representatives.

But both the Senate and governor’s races were closely scrutinized as Florida is traditionally a key swing state in presidential elections.

Florida’s close races and legal disputes over the validity of votes have stirred memories of the 2000 U.S. presidential election, when the U.S. Supreme Court stopped an ongoing recount in the state and sent George W. Bush to the White House.

The Scott campaign called on Nelson to concede. “Last week, Florida voters elected me as their next U.S. Senator and now the ballots have been counted twice,” Scott said in a statement.

Slideshow ( 3 images )

But Nelson attorney Marc Elias said he expected the margin between the two candidates to shrink and “ultimately disappear entirely.”

U.S. District Judge Mark Walker in Tallahassee, Florida, separately ordered election authorities to allow voters a chance to fix signature issues on an estimated 5,000 ballots that were rejected by officials. A Georgia federal judge issued a similar ruling as that state worked to resolve a close governor’s race.

Along with the hand recount, Nelson’s supporters have asked the court to allow mail-in ballots to count if they were postmarked before the election yet arrived too late.

Slideshow ( 3 images )

The Democrats’ majority in the new House expanded by another seat on Thursday when the Maine Secretary of State’s office declared Jared Golden the winner of a race against incumbent Republican Representative Bruce Poliquin. That race represented an early test of a new state ranked-choice voting system, designed to prevent candidates in races with three or more contenders from winning office without majority support.

‘LAUGHING STOCK’

Walker grew testy during a series of Thursday hearings about lawsuits over the recounts, voicing frustration uneven recount progress in different counties and also the Florida legislature’s response to historic election problems.

“We have been the laughing stock of the world election after election,” Walker said. “But we’ve still chosen not to fix this.”

Separately, a federal judge in Georgia on Wednesday ordered state election officials to count some previously rejected ballots in that state’s governor’s race, where ballots are still being tallied but Republican former Secretary of State Brian Kemp has declared victory over Democrat Stacey Abrams.

This year’s campaigns went down as the most expensive midterm elections in U.S. history, with some $5.25 billion spent on advertising, up 78 percent from the last midterm elections in 2014, according to a Kantar Media analysis released on Thursday. Spending was 20 percent higher than the 2016 presidential election.