Story highlights The state of Michigan will fund the replacement of water lines for at least 18,000 Flint households by 2020, according to a settlement

The state will also hire an independent third party to monitor water quality for at least three years after the replacement

(CNN) The state of Michigan will set aside $97 million for lead or galvanized steel water lines to be replaced in the City of Flint, according to a settlement filed Monday in US District Court.

The state will cover the cost of replacing water lines -- the pipes that connect household plumbing to the main distribution pipe running beneath the street -- for at least 18,000 Flint households by 2020, according to the settlement, which resulted from a lawsuit over lead-tainted water in the city.

Michigan will provide $87 million in a combination of state and federal money, according to the settlement; $47 million of that must come from sources other than Obama-era federal water infrastructure improvement funds. In addition, $10 million in federal funds will be put aside in case replacements cost more than expected.

The state will also monitor the water quality of a sampling of homes after the replacement, and hire an independent third party to test and monitor a sampling of at least 100 homes for at least three years.

The City of Flint has agreed to a timeline stipulating they will have replaced pipe lines in a minimum of 6,000 households by 2018, 12,000 by the next year and finally all 18,000 households by 2020, according to the settlement.

Read More