DETROIT (AP) — A judge on Wednesday approved a $626 million settlement for Flint residents and others who were exposed to lead-contaminated water.

Most of the money — $600 million — is coming from the state of Michigan, which was accused of repeatedly overlooking the devastating risks of switching Flint’s water source in 2014 without treating the water to prevent contamination.

READ MORE: Emails Show Officials Sniping Amid 2nd Michigan Lead Crisis

“The settlement reached here is a remarkable achievement for many reasons, not the least of which is that it sets forth a comprehensive compensation program and timeline that is consistent for every qualifying participant,” U.S. District Judge Judith Levy said.

The settlement was announced in August 2020 by Attorney General Dana Nessel and Gov. Gretchen Whitmer, both Democrats, who were elected in 2018 while the litigation was pending.

Flint managers appointed by then-Gov. Rick Snyder and regulators in his administration allowed the city to use the Flint River in 2014-15 without treating the water to reduce corrosion. As a result, lead in old pipes broke off and flowed through taps.

READ MORE: Person Of Interest Turns Himself In After Hit-And-Run That Killed 6-Year-Old In Dearborn

The deal makes money available to every Flint child who was exposed to the water, every adult who can show an injury, certain business owners and anyone who paid water bills.

Flint switched back to a Detroit regional water agency in fall 2015 after Dr. Mona Hanna-Attisha publicly reported elevated lead levels in children.

Attorneys have been seeking as much as $200 million in legal fees from the $626 million settlement.

© 2021 Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.