DETROIT — Prosecutors dropped all criminal charges Thursday against eight people in the Flint water crisis and pledged to start from scratch the investigation into one of the worst man-made environmental disasters in U.S. history.

The stunning decision came more than three years — and millions of dollars — after authorities began examining the roots of the scandal that left Flint's water system tainted with lead. Michigan Solicitor General Fadwa Hammoud, who took control of the investigation in January after the election of a new attorney general, said "all available evidence was not pursued" by the previous team of prosecutors.

Officials took possession this week of "millions of documents and hundreds of new electronic devices, significantly expanding the scope of our investigation," Hammoud and Wayne County prosecutor Kym Worthy said in a statement.

The efforts "have produced the most comprehensive body of evidence to date related to the Flint water crisis," they said, putting investigators "in the best possible position to find the answers the citizens of Flint deserve."

Hammoud's team recently used search warrants to get state-owned mobile devices of former Gov. Rick Snyder and 66 other people from storage.

Among those who had charges dismissed: Michigan's former health director, Nick Lyon, who was accused of involuntary manslaughter for allegedly failing to alert the public in a timely fashion about an outbreak of Legionnaires' disease when Flint was drawing improperly treated water from the Flint River in 2014 and 2015.

The dismissal came a day before a judge planned to announce whether a 2018 decision to send Lyon to trial would stand. Dropping the charges with just hours to spare killed the possibility of an adverse ruling and still gives prosecutors the freedom to haul Lyon into court again.

Nonetheless, defense attorney Chip Chamberlain said they "feel fantastic and vindicated."

"We're confident that a just and fair investigation, done properly, will yield no evidence of any criminal wrongdoing," he said.

Hammoud said she would not speak to reporters until after a June 28 town hall-style meeting with Flint residents. Her boss, Michigan Attorney General Dana Nessel, said a "fearless" team was still on the case.

"Justice delayed is not always justice denied," Nessel said in a statement.

Some residents were skeptical.

"We don't know if new charges will be filed," LeeAnne Walters, who is credited with exposing the lead contamination, told The Associated Press. "It feels kind of degrading, like all that we went through doesn't matter. Our city was poisoned, my children have health issues and the people responsible just had all the charges dropped against them."

While waiting for a new pipeline to bring water from Lake Huron, Flint, a majority-black city of 100,000, pulled water from a river without treating it to reduce corrosive effects on old pipes. Lead contaminated the distribution system in a community where 41% of residents are classified by the government as living in poverty.

Because of its poor finances, Flint was being run by financial managers appointed by Snyder. The uproar over water quality reached a peak by fall 2015, when a doctor reported high levels of lead in children, which can cause brain damage.

Some experts also have linked the water to Legionnaires' disease, a type of pneumonia caused by bacteria that thrive in warm water and infect the lungs. People can get sick if they inhale mist or vapor, typically from cooling systems.

Flint's water no longer comes from the river and has significantly improved, but some residents are so distrustful that they continue to use bottled water.

The criminal probe began in 2016, when Bill Schuette was attorney general. He hired a Detroit-area lawyer, Todd Flood, as special prosecutor. Andy Arena, the former head of the FBI in Detroit, was a key investigator.

No one is behind bars. Seven of 15 people charged pleaded no contest to misdemeanors. Their records will eventually be scrubbed clean.

Charges were pending against eight people, including former Michigan chief medical executive Eden Wells and two men, Gerald Ambrose and Darnell Earley, who were state-appointed emergency managers in Flint. Like Lyon, Wells was charged with involuntary manslaughter.

"We understand that there will be further investigation, but do not expect it to justify any further prosecution relative to her," Wells' attorneys, Steven Tramontin and Jerold Lax, said.

Through March, the investigation and prosecution had cost about $9.5 million, records show. State agencies separately have spent millions of dollars to provide defense lawyers to public employees.

Hammoud dismissed Flood in April and put together a new team. Flood told Detroit television station WJBK on Thursday that he wishes "all the luck in the world" to Hammoud, but he did not directly address the dismissal of cases that he had filed.

"We had an experienced, aggressive and hard-driving team. Everything we did was for the people of Flint," Schuette, Flood's former boss, said on Twitter.