Even before last month’s explosion at the Philadelphia Energy Solutions oil refinery in South Philadelphia, the 1,300-acre facility was going to need major contamination cleanup — hydrocarbons in the soil, benzene and lead and toluene across the area, plumes underground.

As the Philadelphia Fire Department works to secure the site and state inspectors prepare to determine the extent of the damage, regulators and other stakeholders are now looking at a big cleanup job that they didn’t know would come so soon. The historical contamination means the area needs remediation — something Sunoco, which preceded PES as refinery operator, has been working on for several years — and the refinery’s impending closure means a new plan is needed soon.

But no one yet can say how much cleanup is needed on a site that was in operation for so long and is so sprawling that the Department of Environmental Protection says it’s “difficult to characterize contamination issues succinctly.”

» LOOKING AHEAD: Could dream of converting Philly refinery into renewable energy facility turn into reality?

Contaminated sites like the refinery require remediation to stop hazardous substances from moving off-site and to prepare a site to be repurposed. The process generally includes testing, planning, and treating phases to address harmful contamination in the soil, water, or elsewhere in the environment.

“As far as what does the cleanup or what does anything moving forward look like, we don’t know,” DEP spokesperson Virginia Cain said Monday. “It’s day-by-day at this point.”

Because most of the contamination at PES has been around for decades, however, the refinery’s closure doesn’t present any new immediate health dangers to residents or neighbors.

And the June 21 fire did not pose a threat to human health — thanks to luck and quick action that allowed Philadelphia to narrowly dodge a major catastrophe — though it remains to be seen how the blaze could have exacerbated toxic dangers at the site.

“As far as the public’s concerned, what’s going on there in the soil and groundwater has been going on for a very long time,” said Christina Simeone, senior fellow at the Kleinman Center for Energy Policy at the University of Pennsylvania and author of a 2018 report on the refinery. “That doesn’t mean it’s not bad and there’s not concerns, it just means this is not really affected by the explosion.”

While the refinery’s closure turns public attention to its cleanup and the need to mitigate any potential harmful health impacts of the contamination, it also brings one clear environmental benefit: Emissions from the refinery, which is the biggest single polluter in Philadelphia, will stop.

“It should be a fairly dramatic and substantial improvement in air quality,” said Joe Minott, executive director of the Clean Air Council.

The refinery was responsible for nearly three-quarters of carbon monoxide emissions, 88 percent of benzene emissions and 69 percent of formaldehyde emissions in Philadelphia, according to Simeone’s Kleinman Center report.

So what happens next? The cleanup plan is going to depend on whether anyone buys the site, whether it continues to operate as a refinery or is turned into something else, and whether Sunoco alters its previous remediation plan, experts said. Sunoco was required by the U.S. Environmental Protection Agency to clean up the site and then entered into a voluntary state program to complete the remediation. If they complete the program, they’re granted protection from future liability, further remediation and citizen lawsuits regarding the site.

“The pathways for dealing with the remediation really are somewhat impacted by whether the refinery stays open or closes,” Simeone said. “Because the level to which Sunoco remediates could depend on what the intended future use of the site is.”

Sunoco was using site-specific remediation standards that took into account the fact that the facility was in operation with mostly workers and employees on site, Simeone said; if the land is repurposed, it could require stricter cleanup. Sunoco is charged with remediating historical contamination up to 2011; PES is responsible for cleaning up contamination that occurred later.

But the pollution predates Sunoco: researchers believe much of the contamination was dumped in the late 1800s and early 1900s before the industry was regulated and gasoline was just a byproduct of the lamp-lighting kerosene that was being produced there, Simeone said.

Because the contamination has been long recognized, the future cleanup was a problem many saw coming. Activists had been calling for the city to work on a closure plan with the surrounding residents for years. More planning could have been done to protect the now-unemployed refinery workers’ jobs, protect the environment, and consider how to repurpose the space, Minott said.

“Our leaders were asleep at the wheel on this one,” Minott said. “They had plenty of warning and are only now starting to realize the vastness of the problem that they’re going have to deal with.”

He said regulators should not rush the cleanup process.

“I don’t know how bad the contamination is. I think right now, no one knows that,” Minott said. “My plea to the powers that be is that we take the time and we do it right.”

Minott and others have urged the city and stakeholders to involve the public in deciding what to do with the property — particularly the residents whose homes neighbor the refinery.

“It’s never too late, and especially if they’re concerned about union jobs and economic redevelopment,” Simeone said. “The worst-case scenario is Philadelphia has this 1,300 acres that just lays fallow and takes a long time to clean up or isn’t cleaned up.”