MADISON, Wis. (AP) — The state Supreme Court says state regulators can impose operating conditions on factory farms and consider high-capacity wells’ cumulative environmental impacts when weighing whether to grant permits.

The rulings Thursday mark a major win for conservationists and clarify that the Department of Natural Resources has broad authority to protect Wisconsin’s waters.

Environmental groups had sued the DNR seeking stricter regulation of water pollution from factory farms and large-scale water withdrawals from high-capacity wells.

Industry groups including the Dairy Business Association and GOP legislators had argued a 2011 state law limiting state agencies’ regulatory powers trumped the DNR’s broad authority to protect state waters.

Conservation group Clean Wisconsin filed a lawsuit in 2015 demanding the DNR enforce standards that an administrative law judge imposed on an expansion permit for Kinnard Farms in Kewaunee County. The judge imposed permit conditions that called for the farm to monitor its impact on off-site groundwater and limit the number of animals to reduce manure.

The DNR declined to enforce the standards after then-Republican Attorney General Brad Schimel advised the agency that it lacked the authority under the 2011 law, known as Act 21, that prohibits agencies from implementing or enforcing standards that aren’t explicitly laid out in statute.

The farm’s attorney, Jordan Hemaidan, countered that state law doesn’t explicitly say the DNR can enforce groundwater monitoring and animal limits as required by Act 21.