D.G. Yuengling and Son Inc, the oldest U.S. brewing company, will pay close to $10 million to settle charges it violated the federal Clean Water Act through the excessive discharge of pollutants by two large Pennsylvania breweries it operates.

The U.S. Department of Justice and U.S. Environmental Protection Agency on Thursday said Yuengling entered a consent decree under which it will spend about $7 million to upgrade the breweries, located in its hometown of Pottsville, Pennsylvania.

Without admitting liability, Yuengling agreed to set up an environmental management system for the breweries, hire an outside auditor and improve training, the decree said. Yuengling will also pay a $2.8 million civil penalty.

Established in 1829, Yuengling is also one of the largest U.S. craft brewers.

In a statement, Chief Administrative Officer Wendy Yuengling said the family-owned company is pleased to settle and takes its environmental responsibilities seriously.

Thursday’s accord resolves charges that from 2008 to 2015, Yuengling repeatedly violated Clean Water Act requirements for the discharge of industrial waste that goes to municipal treatment facilities.

The government said companies must comply with permit limits on discharges, which often require the “pretreatment” of waste, and that Yuengling violated its pretreatment permit requirements at least 141 times over the eight-year period.

These violations posed a threat to the Schuylkill River, which provides drinking water to about 1.5 million people, the government said.

The Schuylkill River extends to Philadelphia, located about 95 miles (153 km) southeast of Pottsville.

EPA Regional Administrator Shawn Garvin said the case reflects Yuengling’s “history of violations and failure to fully respond to orders from the Greater Pottsville Area Sewer Authority and EPA to correct the problems.”

Yuengling said an $8 million, state-of-the-art wastewater pretreatment system it installed at one of the breweries began operating in March.

The case is U.S. v. D.G. Yuengling and Son Inc, U.S. District Court, Middle District of Pennsylvania, No. 16-01252. (Reporting by Jonathan Stempel in New York; Editing by Chizu Nomiyama and Alan Crosby)