Mosaic Fertilizer LLC will create a $1.8 billion trust fund to cover the future costs to close its Uncle Sam plant and three in Florida, and to treat the plants’ hazardous wastewater, under a settlement announced Thursday.

The deal with the U.S. Environmental Protection Agency and the U.S. Department of Justice resolves a 10-year dispute. The agencies alleged Mosaic’s fertilizer plants in St. James and Independence and four in Florida violated federal law in storing and disposing of waste generated by making phosphoric and sulfuric acids, key components of fertilizers.

Mosaic failed to properly treat, store and dispose of hazardous waste, and also failed to provide adequate financial assurance for closure of its facilities, according to the federal agencies. The settlement will make sure that Mosaic properly treats, stores and disposes of an estimated 60 billion pounds of hazardous waste at Mosaic facilities. The settlement also ensures that wastewater at Mosaic’s facilities is properly managed and does not pose a threat to groundwater resources.

The 60 billion pounds of hazardous waste is the largest amount ever covered by a settlement under the federal Resource Conservation and Recovery Act, the federal agencies said. The law provides guidelines for how hazardous waste must be stored, handled and disposed. The Mosaic plants store hazardous waste from fertilizer production in mounds that can be 500 feet high and cover 600 acres, making them some of the largest man-made waste piles in the country. The piles can also contain several billion gallons of highly acidic wastewater, which can threaten the health of people and the environment. Mosaic also stores the hazardous waste in tanks, ditches and ponds.

Joc O’Rourke, president and CEO of The Mosaic Co., the parent company of Mosaic Fertilizer, said he’s pleased to bring the matter to a close.

“In the years since EPA began this enforcement initiative, Mosaic has voluntarily made a number of major improvements to and significant capital investments in our facilities to enhance environmental performance, and the settlements will build upon that good work,” O’Rourke said.

Under the settlement, Mosaic will establish a $630 million trust fund, which will be invested until it reaches $1.8 billion. In addition to covering future closing and wastewater treatment costs for the Uncle Sam plant and three in Florida, the fund also will cover the long-term care of those facilities.

Mosaic also will spend $170 million on projects to reduce the environmental impact of manufacturing and waste management programs at its facilities. The company will spend $1 million in Louisiana to fund studies regarding statewide water quality issues and $1.2 million on an environmental project in Florida.

Mosaic also will pay a $5 million civil penalty to the United States and $1.55 million to f Louisiana and $1.45 million to Florida.

“This case is a major victory for clean water, public health and communities across Florida and Louisiana,” said Cynthia Giles, assistant administrator for EPA’s Office of Enforcement and Compliance Assurance. “Mining and mineral processing facilities generate more toxic and hazardous waste than any other industrial sector. Reducing environmental impacts from large fertilizer manufacturers’ operations is a national priority for EPA, as part of our commitment to pursuing cases that have the biggest impact on protecting public health.”