Image copyright EPA Image caption Demonstrators had earlier gathered outside Florida's elections office to demand a recount

Florida has ordered a machine recount of votes for state governor and senator following last week's closely fought mid-term elections, officials say.

Florida Secretary of State Ken Detzner said that as unofficial results in both races had fallen within a margin of 0.5%, a recount was required by law.

The two ballots are among the most important yet to be decided.

US President Donald Trump responded to the news by accusing Democrats of trying to "steal" the elections.

The state's Republican Governor Rick Scott, who is standing for the Senate, also warned of electoral fraud, but neither he nor President Trump offered any evidence to back their claims.

The recounts are expected to take several days, but analysts say possible legal challenges mean it could take weeks for the winners to be confirmed.

Mr Detzner has ordered that all 67 Florida counties complete machine recounts for the Senate and gubernatorial races by 15:00 local time on Thursday.

If a machine recount shows a difference of 0.25% or less between the candidates, the state will proceed to a hand recount that must conclude by 18 November, local media report.

What has happened in Florida?

In the race for Florida's Senate seat, unofficial results revealed a gap of just 0.15% between the votes for incumbent Democrat Bill Nelson and Mr Scott.

Democrat Andrew Gillum had already conceded the state governorship, but Ron DeSantis's lead for the Republicans later narrowed to 0.41%.

Media playback is unsupported on your device Media caption How the race for governor played out in the run-up to the vote

After the recount was announced, Mr Gillum said: "I am replacing my words of concession with an uncompromised and unapologetic call that we count every single vote."

Mr DeSantis, however, insisted that the results were "clear and unambiguous, just as they were on election night".

"It is important that everyone involved in the election process strictly adhere to the rule of law which is the foundation for our nation," he added.

Mr Trump had earlier said there was "a lot of dishonesty" over contested votes.

Some candidates have already launched legal action. Mr Scott, who claimed victory on Tuesday, is suing officials over an election recount, while Mr Nelson is suing over uncounted ballots - and there have also been a number of protests outside the elections office.

Mr Scott called on sheriffs in every county to closely monitor the recount process, tweeting: "We will not let unethical liberals steal this election!

"It's time Senator Nelson accepts these results and allows the state of Florida to move forward to a better future."

In one of his three lawsuits against election overseers, Mr Scott has asked a judge to impound voting machines and ballots when they are not in use.

Mr Nelson responded to the legal action in a statement on Sunday, saying his rival, the state's outgoing governor, was making "false and panicked" voter fraud claims because he was afraid of losing.

"If Rick Scott wanted to make sure every legal ballot is counted, he would not be suing to try and stop voters from having their legal ballot counted as intended," said the Democratic incumbent.

Authorities have meanwhile shot down a conspiracy theory about ballot fraud.

Florida Senator Marco Rubio was among those who retweeted a photo showing a box labelled "provisional ballots" found at a school, raising concerns about possible foul play.

But election officials stated that the box contained only supplies.

What else did Mr Trump say?

Mr Trump told reporters on Friday, before leaving for Paris to commemorate the 100th anniversary of the end of World War One, that he believed that Mr Scott had clearly won the election.

The president said he would send his lawyers to Florida "to expose the fraud", calling the Nelson campaign's recount lawyer Marc Elias an election stealer.

Florida has a history with close elections. In 2000, George W Bush and Al Gore faced an impasse with the presidential vote hanging in the balance amid weeks of legal wrangling.

Mr Gore's fate was finally sealed by a US Supreme Court ruling that said in essence that time had run out for recounts in the crucial state, granting Mr Bush the presidency.

Which other races are still undecided?

In Georgia's gubernatorial election, Democrat Stacey Abrams is refusing to concede in her race against Republican Brian Kemp.

Mr Kemp declared victory on Wednesday with a narrow lead but campaign officials for Ms Abrams have started a legal challenge to ensure all votes are counted.

Image copyright Getty Images Image caption Stacey Abrams has not yet conceded in Georgia

Her supporters have claimed that issues such as ballot machines supplied without power cables and four-hour queues unfairly helped Mr Kemp.

An ongoing tally has whittled Mr Kemp's lead slightly to under 60,000 votes, the Atlanta Journal-Constitution reports.

But Ms Abrams still needs another 22,000 votes to trigger a run-off election next month, and it is unclear how many ballots remain outstanding.

In Arizona, another tight senate race has yet to conclude between two US congresswomen - Republican Martha McSally and Democrat Kyrsten Sinema.

With mail-in votes still being counted, Ms Sinema had widened her narrow lead to more than 30,000 votes by Sunday (1.4|%), US media report.