DETROIT (WWJ/AP) — Michigan and the city of Flint have agreed to replace thousands of home water lines under a sweeping deal to settle a lawsuit over lead-contaminated water in the troubled city.

A court filing Monday says Flint will replace at least 18,000 lead or galvanized-steel water lines by 2020, and the state will pick up the bill with state and federal money. The state said it will pay $87 million and keep another $10 million in reserve if necessary.

READ MORE: COVID-19 Vaccines Saved Nearly 20 Million Lives In First Year, Study Says

The settlement will be presented to a federal judge in Detroit on Tuesday for approval.

Flint’s water was tainted with lead for at least 18 months, as the city tapped the Flint River but didn’t treat the water to reduce corrosion. As a result, lead leached from old pipes and fixtures.

At the time, officials estimated the cost of buying water from Detroit in 2014 came at an estimated cost of $16 million, and the overall annual cost of switching to the new Karegnondi Water Authority would be $12.5 million.

READ MORE: Michigan Ballot Initiative Aims To Protect Abortion Rights

Residents immediately complain about the smell, taste and appearance of the water. They also raise health concerns, reporting rashes, hair loss and other problems.

Since the summer of 2014, 87 cases of Legionnaires’ disease have been reported in the area resulting in ten fatalities — and about half the cases involve people drinking Flint water.

Legionnaires’ disease is a type of pneumonia caused by bacteria that infect the lungs.

 

MORE NEWS: AG Nessel Says Abortions Are Still Legal In Michigan

(© Copyright 2017 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)