Nearly three dozen advocacy groups are calling on the Environmental Protection Agency to close loopholes that they say have allowed massive factory farms to continue polluting waterways with animal waste.

The groups are asking the agency to fix its rules for permitting Concentrated Animal Feeding Operations, or CAFOs, which can house tens of thousands of animals and have become one of the most significant sources of water pollution in the nation. The effort is part of a broader one aimed at forcing stronger oversight of CAFOs, including their contributions to greenhouse gas emissions.

In a petition filed this week, 35 groups led by Food & Water Watch, maintain that EPA has the authority to require more CAFOs to seek permits that would limit the amount of animal waste that ends up on farm fields and in waterways. Among other things, the groups are asking that the agency rely on more current rainfall data that reflects extreme weather events fueled by climate change.

"The current rules have failed to prevent pollution," said Tarah Heinzen, an attorney with Food & Water Watch. "So we're urging EPA to adopt rules that require more CAFOs to get permits and to make those permits more stringent."

The petition likely will open up an ongoing legal battle that stretches back nearly two decades in which courts have consistently sided with the livestock industry and against the agency.

The Clean Water Act defines CAFOs as "point sources" of pollution—much like factories or municipal sewage systems. But the farming industry has fought against that definition and won exemptions from regulation.

In the 1990s, at least a dozen CAFOs spilled liquid waste into lakes and streams, prompting environmental groups to sue the agency to impose stronger regulations. The EPA responded, saying for the first time that all CAFOs would be required to get permits under the Clean Water Act—unless they could prove they didn't have the potential to pollute. The livestock industry fought back, saying that the agency couldn't require permits unless facilities were actually discharging waste into waterways.

Ultimately, after a series of lawsuits, a federal appeals courts said that the agency couldn't require permits, unless a facility was discharging. Without permits, the agency doesn't know where these farming operations are located, or, in some cases, if they even exist, and has no way of monitoring if they mishandle waste or pollute waterways, environmental groups say.

The new petition, though, challenges EPA to require that any livestock facility that has certain characteristics—that it houses a certain number of animals, for instance, or has a certain kind of manure management system—obtain a permit.

The agency has said as many as 75 percent of CAFOs need permits because they discharge based on these characteristics, but only 40 percent actually have them.

"We're saying EPA had enough information to establish a presumption that certain facilities, with certain characteristics, actually discharge and require permits," Heinzen said.

The groups are also asking the agency to close a loophole that excludes these facilities from permitting requirements under an "agricultural stormwater exemption." That means, the groups say, that CAFOs are getting around permitting requirements. The Clean Water Act doesn't clearly outline what qualifies as an agricultural stormwater, leaving much room for legal interpretation, but the agency has authority to define it, the groups say.

The petition also points out that extreme weather events—including the storms that swept across North Carolina last year, spilling massive amounts of liquid waste into the state's waters—are becoming more common.

Under the current rules, EPA allows CAFOs to discharge pollutants when they're hit with severe storms—those that are categorized as "25-year, 24-hour" storms, meaning a storm lasting 24 hours that has a chance of recurring once in 25 years.

"If there's a massive storm event, it hasn't violated its permit," Heinzen said. "But the way that EPA determines what storm events triggers that exemption is really outdated. It's based on a rainwater atlas from 1961."

Neither the EPA or the American Farm Bureau Federation, which represents the livestock industries that sued the agency over the permitting rules, immediately responded to requests for comment.