Miguel Del Toral, a scientist for the Environmental Protection Agency, is one of the heroes of the Flint water crisis.

Susan Hedman, EPA director of Region 5, which includes Michigan, resigned as a result of her handling of the situation.

While state government was the primary player in the Flint water crisis, the EPA also had a critical role: It was the first agency to recognize the problem with lead in the water, but also prolonged the situation by failing to act more decisively, emails, documents and interviews show.

Since states enforce federal drinking water standards, the EPA wasn't involved in April 2014 when Flint switched its drinking water to the Flint River.

Ten months later, an EPA official heard from a Flint resident whose drinking water tested high for lead. In conversations about that case with the Michigan Department of Environmental Quality, the EPA discovered the DEQ misread a federal regulation and failed to require corrosion control in treating the river water.

That mistake caused the crisis.

During the 47 years Flint was using pre-treated Detroit water, a protective scaling developed on the inside walls of Flint's water pipes. But the corrosive river water ate through that protective layer, allowing lead from the pipes to leach into the drinking water.

While Del Toral put his finger on the problem in a February 2015 email to the DEQ Office of Drinking Water and Municipal Assistance, the DEQ staff denied an issue existed.

That started a months-long battle between federal and state drinking water officials.

Del Toral and others in the EPA repeatedly told their DEQ counterparts they were wrong in saying corrosion control was legally required. Del Toral also warned, to no avail, that lack of corrosion control could result in systemic lead contamination of the water, plus the DEQ's testing procedures could understate the amount of lead in the water.

"Given the very high lead levels found at one home and the pre-flushing happening at Flint, I'm worried that the whole town may have much higher lead levels than the compliance results indicated," Del Toral wrote in an April 25, 2015 email to the DEQ.

The argument went public in early July 2015, when the news media reported on an internal memo written by Del Toral detailing his concerns.

When Hedman, Del Toral's boss, was asked to comment, she could have confirmed that DEQ's obstinance was putting Flint residents at risk. Instead, she issued a bland statement saying the EPA was working with state and local officials "to ensure that Flint residents are provided with safe drinking water."

Likewise, when Flint Mayor Dayne Walling asked Hedman in July if Flint residents should be concerned about the Del Toral memo, Hedman failed to sound the alarm.

It was an interim report, she told Walling, and the EPA would keep the city posted.

It was a pattern that continued through the summer and into the fall as concerns about lead contamination in Flint heated up.

Privately, the EPA nagged, the emails show. Publicly, the EPA said nothing to contradict DEQ's strenuous assertions the water was safe.

State Senate Minority Leader Jim Ananich, who lives in Flint, was among those briefed by the EPA and DEQ about Flint water in mid-September.

The EPA "had the same arrogant approach" as the DEQ, that "everything was fine," Ananich said.

A few days later, on Sept. 24, Flint pediatrician Dr. Mona Hanna-Attisha held a news conference to announce lead levels had increased in Flint children since the switch in water supply.

Michigan officials continued to dig in their heels to insist the water was safe.

The DEQ and Department of Community Health "feel that some in Flint are taking the very sensitive issue of children's exposure to lead and trying to turn it into a political football claiming the departments are underestimating the impact on the populations and trying to shift responsibility to the state," Dennis Muchmore, then-chief of staff to Gov. Rick Snyder, wrote in a Sept. 25 email to Snyder.

But Hanna-Attisha's study caught the attention of EPA Director Gina McCarthy, who organized a phone conference of her senior staff on Saturday, Sept. 26, to discuss the water situation in Flint, according to EPA emails.

"Seems like the Flint lead issue is really getting concerning," McCarthy told her staff in an email exchange. "Let's look at options to intervene. ...Would seem the state needs to step up here."

After the phone conference, Hedman called DEQ Director Dan Wyant the next day, a Sunday. It was their first conversation about the controversy that had been playing out among mid-level DEQ and EPA officials for months.

Hedman emailed her colleagues that Wyant agreed the state needed to step up.

In retrospect, that conversation appears to be "pivotal" in getting Michigan officials to recognize Flint's issues with lead, EPA spokeswoman Monica Lee said.

On Monday morning, Sept. 28, Wyant had a conference call with the governor, along with Nick Lyon, the head of the Department of Health and Human Services. Snyder later said this was the first time he was told state officials might be wrong with their assertions that Flint water was safe.

That evening, Hedman reported to her EPA colleagues that Snyder was drafting an action plan -- the plan that was unveiled at a news conference Oct. 2.

In the eyes of many, it was too little, too late.

EPA officials have since explained their reluctance to intervene by pointing to federal statutes that give the states the primary enforcement rights on drinking-water issues and the EPA to intervene only if the state refuses to take action.

"From Day One, the state provided our regional office with confusing, incomplete, and absolutely incorrect information," McCarthy said in testimony during a Congressional hearing in March. "In hindsight, we should not have been so trusting of the state for so long.

"I will take responsibility for not pushing hard enough, but I will not take responsibility for causing this problem," she said. "It was not EPA at the helm when this happened."

In a report issued in March, the Flint Water Advisory Task Force -- a five-member group appointed by Snyder to investigate the crisis -- agreed the state bears the brunt of the blame for the crisis. But the report also notes the EPA didn't override the DEQ's authority until January this year -- 11 months after the EPA became aware of a potential problem.

"There's no excuse for that," said Ken Sikkema, task force co-chair. "They could have taken enforcement action earlier, and they should have."

Congressman Dan Kildee, D-Flint, a harsh critic of Snyder's handling of the Flint water crisis, is a little more sympathetic toward the EPA.

"Statutory regulation makes it difficult for the federal government to override that state authority," Kildee said.

But he agrees the EPA should have gone public with their concerns much earlier.

"If there's problems with the water and kids are drinking it, they need to speak up," Kildee said.

Julie Mack is a reporter on MLive's Impact Team. Contact her at jmack1@mlive.com.