TALLAHASSEE, Fla. (AP) — Florida officials say thousands of mailed ballots were not counted because they were delivered too late to state election offices.

The Department of State last week informed a federal judge that 6,670 ballots were mailed ahead of the Nov. 6 election but were not counted because they were not received by Election Day. The tally prepared by state officials includes totals from 65 of Florida's 67 counties.

Three statewide Florida races, including the contest for governor, went to recounts because the margins were so close.

Under Florida law, ballots mailed inside the United States must reach election offices by 7 p.m. on Election Day. Overseas ballots are counted if they are received up to 10 days after the election.

A veterans group and Democrats challenged the law in federal court.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.