TALLAHASSEE, Fla. (AP) — A federal judge slammed Florida on Thursday for repeatedly failing to anticipate election problems and said the state law on recounts appears to violate the U.S. Supreme Court ruling that decided the presidency in 2000.

U.S. District Judge Mark Walker also rejected a request to extend the deadline later in the day for all of the state’s counties to submit the results of a machine recount.

“We have been the laughingstock of the world, election after election, and we chose not to fix this,” Walker said in court.

Walker vented his anger at state lawmakers and Palm Beach County officials, saying they should have made sure they had enough equipment in place to handle this kind of a recount.

The overarching problem was created by the Florida Legislature, which Walker said passed a recount law that appears to run afoul of the 2000 Bush v. Gore decision, by locking in procedures that do not allow for potential problems.

Florida’s 67 counties faced a 3 p.m. Thursday deadline to finish recounts that could determine the next senator and governor in one of America’s top political battlegrounds.

A total of six election-related lawsuits are pending in Tallahassee. Earlier Thursday, Walker ordered that voters be given until 5 p.m. Saturday to show a valid identification and fix their ballots if they have not been counted due to mismatched signatures.

State officials testified that nearly 4,000 mailed-in ballots were set aside because local officials decided the signature on the envelope did not match the signature on file. If those voters can prove their identity, their votes will now be counted and included in final official returns due from each county by noon Sunday.

Meanwhile, the recount threatened to stretch into the weekend. The election supervisor in Palm Beach County, a Democratic stronghold, warned that her office may not meet Thursday’s initial deadline.

More than a week after Election Day, an immediate resolution seems unlikely.

Once the machine recount is complete, state law requires a hand review of races with margins of less than 0.25 percentage points. That almost certainly means another recount in the Senate race, with unofficial results showing Republican Gov. Rick Scott ahead of Nelson by 0.14 percentage points.

Also, the election will not be certified until Tuesday, even though the machine recount may essentially bring a conclusion to the governor’s race, where Republican Ron DeSantis leads Democrat Andrew Gillum by 0.41 percentage points in unofficial results.

Nelson, a three-time incumbent, has defended his legal strategy that resulted in Walker’s ruling, saying in a statement Wednesday that his goal was to “to make sure that every lawful vote be counted correctly in this Senate race, and that Floridians’ right to participate in this process is protected.”

Republicans say in their own lawsuits and motions that Democrats are trying to change the rules after the voting did not go their way.

“We will continue to fight to defend Florida law and uphold the will of the voters,” said Chris Hartline, a spokesman for Scott.

Nelson and Democrats had wanted Walker to order the counting of all mail-in ballots rejected for a mismatched signature, arguing that local election officials are not handwriting experts.

Walker said he could not go along with that suggestion.

“Let this court be clear: It is not ordering county canvassing boards to count every mismatched vote, sight unseen,” Walker wrote in his 34-page ruling.

Lauren Schenone, a spokeswoman for Scott, called Walker’s ruling “baseless” and said they were “confident” it would be overturned by the Atlanta-based appellate court.

The developments are fueling frustrations among Democrats and Republicans alike. Democrats want state officials to do whatever it takes to make sure every eligible vote is counted. Republicans, including President Donald Trump, have argued without evidence that voter fraud threatens to steal races from the GOP.

Just when state officials will get recount results from all counties remains unclear. Tallying machines overheated earlier this week in Palm Beach County. That caused mismatched results with the recount of 174,000 early voting ballots, forcing staffers to go back and redo their work.

The county’s Supervisor of Elections Susan Bucher said the machines underwent maintenance right before the election, but “I don’t think they were designed to work 24/7.”