A federal judge Monday threw out a major Trump administration rule that scaled back federal protections for streams, marshes and wetlands across the United States, reversing one of the previous administration’s most significant environmental rollbacks.

U.S. District Judge Rosemary Márquez wrote that Trump officials committed serious errors while writing the regulation, finalized last year, and that leaving it in place could lead to “serious environmental harm.”

A number of business and farm groups had supported the push to replace Obama-era standards with the Navigable Waters Protection Rule, on the grounds that states were better positioned to regulate many waterways and that the previous protections were too restrictive.

The ruling in the U.S. District Court for the District of Arizona, which applies nationwide, will afford new protections for drinking-water supplies for millions of Americans, as well as for thousands of wildlife species that depend on America’s wetland acreage.

Márquez, a Barack Obama appointee, noted that the U.S. Army Corps of Engineers, which oversees permits to dredge and fill waterways under federal jurisdiction, determined that three-quarters of the water bodies it reviewed over a nearly 10-month period did not qualify for federal protection under the new rule. Federal agencies identified 333 projects that would have required a review under the Obama rule, she added, but did not merit one under the Trump standards.

“We are reviewing the ruling,” said Environmental Protection Agency spokesman Nick Conger, who declined to comment further.

The decision underscores the extent to which legal fights are shaping environmental policy across the country. Just this month, the Interior Department said it would resume auctioning off new oil and gas leases to comply with an order by a Louisiana federal judge, while another federal judge blocked a controversial oil project planned for Alaska’s North Slope.

Home builders, oil drillers and farmers — who have long argued that earlier restrictions on developing land made it too difficult to do their work — are likely to appeal.

“The fallout for private property owners, especially farmers, is that they’re going to be cast back into a situation where they have a lot more uncertainty,” said Mandy Gunasekara, who served as EPA’s chief of staff during Trump’s last year in office.

In June, the Biden administration announced that it would write regulations to strengthen wetland protections but would keep the Trump-era rule on the books while it did so. But tribal and environmental groups pressed the court in Arizona to vacate the previous administration’s rule sooner, since some wetlands may be irreparably harmed during the time it would take to replace it.

“We came in and said, ‘No, no, no, no, you can’t leave this in place,’" said Janette Brimmer, a senior attorney for Earthjustice, which represented the Native American and green groups in court. She added, “This is hugely good.”

The ruling marks the latest salvo in a decades-long legal and regulatory battle over the full extent of the Clean Water Act’s reach.

That landmark 1972 law prohibits polluting “waters of the United States” without a permit. But the question of which waterways fall under that category has been debated in courtrooms and agencies ever since.

In 2015, Obama’s administration moved to protect a broad swath of water bodies, including “ephemeral” streams that appear only after rainfall and help purify water. Hydrologists have found that even these intermittent rivulets can affect the water quality of large rivers and lakes downstream.

But the Trump administration replaced that regulation with a far narrower one, on the grounds that the Obama rule exceeded the government’s legal authority.

“They basically ignored it all,” Mark Ryan, a former EPA lawyer who helped craft the Obama-era regulation, said of the Trump team. “It was a voluminous bit of science.”

But American Farm Bureau Federation President Zippy Duvall noted that other courts — including one last month in South Carolina — declined to dismantle the Trump-era rule when pressed by environmentalists.

“We are reviewing the ruling to determine our next course of action," he added in a statement. "Farmers and ranchers deserve consistency and a rule that is fair and doesn’t require a team of attorneys to interpret.”

With Monday’s court ruling, agencies will go back to applying water protection standards from the 1980s, which are more expansive than the Trump-era rule but not as sweeping as Obama’s.

The push to overhaul federal clean-water regulations has caused ongoing fights in places such as in Georgia, near the sprawling Okefenokee Swamp. A proposal to strip-mine for titanium would have received strict scrutiny under the Obama-era standards, and some federal officials and environmental groups raised concerns about its potential impacts.

But last year the Army Corps of Engineers determined that under the revised Trump rule, the area was no longer federally protected.

The project is still subject to state permitting requirements, and Twin Pines, the Alabama-based company behind the effort, argued that it could safely mine on hundreds of acres near the Georgia-Florida border. The swamp “is a natural treasure, which we want to preserve as much as those who have opposed our proposal,” a top company official told The Washington Post last year.

Still, activists rejoiced at Monday’s decision.

“This is a welcome day for the Okefenokee, the wetlands surrounding the refuge, and will force Twin Pines to reevaluate this disastrous project,” Christian Hunt, Southeast program representative for Defenders of Wildlife, said in an email.