A judge has ordered Flint, Michigan, to replace any remaining lead or steel water lines by Aug. 1, the latest intervention after a series of missed deadlines.

U.S. District Judge David Lawson signed off on an agreement between the city and the Natural Resources Defense Council, which represents residents in long-running litigation that began in 2016.

For 18 months, until fall 2015, Flint was pulling water from the Flint River without treating it to prevent corrosion inside old pipes. Lead contaminated the system as a result.

FLINT WATER CRISIS: MICHIGAN JUDGE TOSSES CHARGES AGAINST 7 PEOPLE

More than 10,000 pipes have been replaced, though at least 1,000 addresses still haven't been inspected, according to the NRDC.

Michigan Fox News graphic

A judge has ruled that Flint, Michigan, must replace all of its water pipes by Aug. 1.

Separately, residents have complained about sidewalks that haven't been repaired after excavations and yards that look bad.

"I have attempted to plant grass in the area the city dug up. This hasn't worked, and my front lawn looks like it has a bald spot," Sidney Hemphill told the judge.

SUPREME COURT PUSHES FORWARD FLINT WATER CRISIS VICTIMS' CASE, SAYS CITY OFFICIALS NOT IMMUNE TO PROSECUTION

Flint has until May 1 to determine which yards need repairs, Lawson said Friday.

The city said it has checked water lines at more than 95% of the thousands of targeted addresses. It cited the COVID-19 pandemic and a shortage of copper pipe and other materials as reasons for any lag.

"The city has not been ‘sitting back and doing nothing,’" attorney Joseph Kuptz said in a court filing. "The opposite is true. The city has been actively, intentionally and diligently moving forward with the task at hand."

CLICK HERE TO GET THE FOX NEWS APP

Nearly $100 million for the project came from state and federal governments. Flint returned to a Detroit-area water supplier in fall 2015.