Florida school districts can legally require their students to wear masks to prevent the spread of COVID-19, a judge ruled Friday, saying Gov. Ron DeSantis overstepped his authority when he issued an executive order banning such mandates.

Leon County Circuit Judge John C. Cooper agreed with a group of parents who claimed in a lawsuit that DeSantis’ order is unconstitutional and cannot be enforced. The governor’s order gave parents the sole right to decide if their child wears a mask at school.

Cooper said DeSantis’ order “is without legal authority.”

His decision came after a four-day virtual hearing, and after 10 Florida school boards voted to defy DeSantis and impose mask requirements with no parental opt-out. Districts that have done so include Miami, Fort Lauderdale, Orlando, Tampa, Jacksonville, West Palm Beach and others. Cooper’s ruling will not go into effect until it is put into writing, which the judge asked the parents’ lawyers to complete by Monday.

Cooper said that while the governor and others have argued that a new Florida law gives parents the ultimate authority to oversee health issues for their children, it also exempts government actions that are needed to protect public health and are reasonable and limited in scope. He said a school district’s decision to require student masking to prevent the spread of the virus falls within that exemption.

The judge also noted that two Florida Supreme Court decisions from 1914 and 1939 found that individual rights are limited by their impact on the rights of others. For example, he said, adults have the right to drink alcohol but not to drive drunk, because that endangers others. There is a right to free speech, but not to harass or threaten others or yell “fire” in a crowded theater, he said.

In that same vein, he said, school boards can reasonably argue that maskless students endanger the health of other students and teachers.

DeSantis has dismissed the recommendation from the Centers for Disease Control and Prevention that people wear masks, questioning its legitimacy and saying it is not applicable to Florida. But Cooper said the state’s medical experts who testified during the trial that masking is ineffective in preventing COVID-19′s spread are in a distinct minority among doctors and scientists. He also said that while DeSantis frequently states that a Brown University study concluded masks are ineffective, the study’s authors wrote that no such conclusion should be drawn.

“I don’t say that the governor has time enough to read a report that thick, but his advisers do … and that statement is incorrect,” Cooper said.

“It’s not surprising that Judge Cooper would rule against parents’ rights and their ability to make the best educational and medical decisions for their family, but instead rule in favor of elected politicians,” spokeswoman Taryn Fenske said in a statement. “This ruling was made with incoherent justifications, not based in science and facts — frankly not even remotely focused on the merits of the case presented.”

Craig Whisenhunt, one of the attorneys representing the parents, called DeSantis’ actions in the case “atrocious” and called him “a bully in the room that is beating up children.”

“The path that he took showed evidence of some cowardice,” he said. If DeSantis really believed the parental rights law barred districts from imposing mask mandates, he wouldn’t have issued an executive order — he would have taken the districts to court and gotten a judge to block them, Whisenhunt said.

One of the parents who sued the state, Amy Nell of the Tampa area, said that when Cooper ruled, “I really felt heard for the first time in a while.”

“Since the beginning of the school year it has felt like bizarro world. We are being told that science — what we think it is and everything we know about viruses — may be not true,” said Nell, whose son is in elementary school.

The highly contagious delta variant led to an acceleration in cases around Florida and record high hospitalizations just as schools prepared to reopen classrooms this month. By mid-August, more than 21,000 new cases were being added per day, compared with about 8,500 a month earlier. Over the past week, new cases and hospitalizations have leveled off. There were 16,550 people hospitalized on Thursday, down from a record of above 17,000 last week — but still almost nine times the 1,800 who were hospitalized in June.

The 10 districts that have defied DeSantis’ order represent slightly more than half of the 2.8 million Florida public school students enrolled this year. The governor, a Republican who is eyeing a possible presidential run in 2024, had threatened to impose financial penalties on school boards, specifically threatening two districts in Democratic strongholds that voted for strict mask mandates. Democratic President Joe Biden said if that happened, federal money would be used to cover any costs.

The superintendent of one of the targeted districts, Carlee Simon of Alachua, said in a written statement that Cooper’s ruling “is a validation of the right of locally-elected school boards to protect their students and communities during this crisis without fear of political or financial retribution.”

About 6 in 10 Americans say students and teachers should be required to wear face masks while in school, according to a poll conducted this month by The Associated Press-NORC Center for Public Affairs Research.