DuPont has agreed to replace tens of thousands of trees killed by its herbicide, Imprelis, across the country as part of a settlement agreement that got preliminary approval from a federal judge this week.

The settlement, filed in October of last year, was the product of months of discussion and mediation from a retired magistrate judge, according to the opinion in In re Imprelis Herbicide Marketing, Sales Practices and Products Liability Litigation.