In this Wednesday, Aug. 1, 2018 photo, a clean-out ditch is seen at far right at the Powder Mill Fish Hatchery in New Durham, N.H. The state has reached an agreement to upgrade the hatchery over pollution concerns. Credit: Elise Amendola / AP

CONCORD, N.H. — New Hampshire has agreed to make upgrades at its largest fish hatchery as part of a proposed settlement following allegations that the facility was polluting nearby waterways, the U.S. Department of Justice announced Thursday.

The state will take action to reduce phosphorus in its discharges from the Powder Mill State Fish Hatchery to the Merrymeeting River. As part of the settlement, the state agreed to construct a new wastewater treatment systems. It also agreed to reconfigure the facility’s tanks to promote the settling of solids containing phosphorus so it can meet permit limits by Dec. 31, 2025.

“This settlement demonstrates that the Department of Justice and Environmental Protection Agency are committed to addressing risks to water quality in our nation’s rivers and streams,” Assistant Attorney General Todd Kim, of the Justice Department’s Environment and Natural Resources Division, said in a statement. “This settlement will lead to significant reductions in phosphorus discharges to the Merrymeeting River and downstream ponds and help reduce risks to anyone fishing or coming into contact with these waters.”

David Cash, the regional administrator for EPA’s New England office, said the settlement also addresses concerns about harmful algal blooms which are on the rise in the region.

The settlement comes nearly four years after the Conservation Law Foundation sued the state over the issue. In its federal lawsuit, the foundation accused the state Department of Fish & Game, which owns and operates the hatchery, of degrading the Merrymeeting River with fish waste it discharges, leading to harmful algae blooms, decreased property values and limited recreation.

The state Department of Fish & Game and Environmental Services had argued that the hatchery has been in compliance with its permit that was years overdue for an update.

The state has implemented short-term changes to improve discharge including changing to lower-phosphorus fish food, moving some fish to other hatcheries, and storing waste for land application as fertilizer instead of putting it into the river.

It did not respond Thursday to a request for comment.