Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Activists and public officials alike welcomed a deal Tuesday that will rip up thousands of corroded water lines in Flint, Michigan, but they said the lead-contaminated city still has a long way to go before it's back on its feet.

A U.S. district judge in Detroit approved a settlement in a lawsuit on Tuesday, freeing up almost $100 million in state money to tear out lead or galvanized-steel water lines leading to at least 18,000 Flint homes by Jan. 1, 2020.

"I am happy," Mayor Karen Weaver said after the hearing, calling the settlement a "step in the right direction ... as we work to recover from the man-made water disaster."

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

In a statement, she added: "By being included in this settlement, these terms of agreement are now enforceable by court order, and that is a good thing. We will continue to work with all concerned parties to move the city of Flint forward and protect the health and safety of the citizens of Flint."

As part of the settlement, the state of Michigan has agreed to spend $87 million to rip up, inspect and replace miles of waterlines and to set aside an additional $10 million for unexpected extra expenses.

Gov. Rick Snyder said Tuesday that the deal proves "the state's commitment to providing the resources necessary for the residents of Flint to recover from the crisis."

Related: Bad Decisions, Broken Promises: A Timeline of the Flint Water Crisis

Dimple Chaudhary of the Natural Resources Defense Council, lead counsel for the plaintiffs — who include Flint resident Melissa Mays, the American Civil Liberties Union and the activist group Concerned Pastors for Social Action — said the deal is the first enforceable commitment to get lead-contaminated pipes out of the ground in Flint.

Corroded water pipes at a Flint, Michigan, facility. NBC News Channel - file

"The people of Flint are owed at least this much," Chaudhary said.

Michael Steinberg, legal director of the ACLU of Michigan, said he was pleased that "Flint can finally look forward to a long-term solution to a catastrophe that has devastated the community."

"This groundbreaking settlement marks a huge step toward restoring a long-neglected community to some semblance of normalcy," Steinberg said.

In addition to paying to rip up and replace miles of old water lines, Michigan and Flint agreed to pay almost $1 million to the plaintiffs.

The plaintiffs agreed to drop their demand that the city deliver bottled water door to door. Instead, Flint residents will be able to call the city's 211 number and order free water for delivery within 24 hours.