FILE - In this March 21, 2016 file photo, the Flint Water Plant water tower is seen in Flint, Mich. The U.S. Environmental Protection Agency said on March 27, 2017, that a $100 million grant to address drinking water issues in the city was approved after a formal application from Michigan state officials. (AP Photo/Carlos Osorio, File)

FILE - In this March 21, 2016 file photo, the Flint Water Plant water tower is seen in Flint, Mich. The U.S. Environmental Protection Agency said on March 27, 2017, that a $100 million grant to address drinking water issues in the city was approved after a formal application from Michigan state officials. (AP Photo/Carlos Osorio, File)

DETROIT (AP) — Michigan and the city of Flint agreed Monday to replace thousands of home water lines under a sweeping deal to settle a lawsuit by residents over lead-contaminated water in the struggling community.

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, according to the settlement filed in federal court. It will be presented Tuesday to U.S. District Judge David Lawson for likely approval.

More than 700 water lines already have been replaced and work is ongoing, but the agreement would rid Flint’s roughly 100,000 residents of uncertainty over how to pay for the enormous task. Under the settlement, the state will set aside $87 million and keep another $10 million in reserve if necessary.

ADVERTISEMENT

“The proposed agreement is a win for the people of Flint,” said Dimple Chaudhary, an attorney with the Natural Resources Defense Council, which is working with the American Civil Liberties Union of Michigan to represent Flint residents.

“It provides a comprehensive framework to address lead in Flint tap water and covers a number of critical issues related to water safety,” Chaudhary told The Associated Press.

Despite the development, some residents still feel discouraged. Reneta Richard, a 38-year-old teacher, said another few years for new pipes “compiles the despair that I see and feel.” She heats bottled water for kitchen use because hot tap water can damage the filter.

“When I see someone on TV just turn on the water and wash their hands — I haven’t been able to do that for years,” Richard said.

Flint’s water was tainted with lead for at least 18 months, starting in spring 2014. The city, under the control of state-appointed financial managers, tapped the Flint River while a new pipeline was being built to Lake Huron, but the water wasn’t treated to reduce corrosion. As a result, lead leached from old pipes and fixtures.

Gov. Rick Snyder finally acknowledged the disaster in fall 2015 after elevated lead levels were found in children. Water quality has improved since Flint returned to the Detroit regional system, but residents still are advised to use filters.

The agreement filed Monday was the result of negotiations involving a court-appointed mediator. In November, Lawson ordered the state to deliver bottled water to residents who have trouble with filters, although the state said that remedy would be extremely difficult to meet.

Residents who get new water lines will be urged to continue using a filter for six months. There will be no cost for replacement cartridges or household testing kits.

There will be tests for lead in the Flint system every six months until one year after the replacement of water lines. An independent monitor also will check household water samples for lead, and the results will be posted online.

The agreement also includes ways for the state to begin closing the nine Flint water distribution sites, starting May 1, depending on demand. They all could be closed after Sept. 1, depending on tap water quality.

___

Follow Ed White at http://twitter.com/edwhiteap