WAYNESBORO, Va. — Chemical company DuPont will pay about $50 million under an environmental settlement that aims to make up for decades of mercury pollution one of its factories released into the South River in Virginia.

A federal judge approved the deal between Wilmington, Delaware-based DuPont Co. and the state and federal government last week. Court documents say it’s the largest natural resources damages settlement in Virginia history.

It includes more than $42 million for natural resource restoration projects, including fishing improvements and land protection. The company will also restore a fish hatchery, likely to cost $7 million to $8 million, and reimburse some government assessment expenses.

Officials have said mercury from a Waynesboro plant seeped into the South River and flowed downstream to the South Fork Shenandoah River and Shenandoah River.