Scores of city residents were displaced from their homes and diverted traffic was snarled while firefighters battled for more than 10 hours to tamp down

In its footprint, in the bowels of the Albert Street building, the fire left mangled metal, torn-down walls and a few tires that somehow survived the hellacious temperatures.

Pools of white foam flowed out of the facility late Thursday night, making its way to the city’s drainage gutters, and possibly, to the Naugatuck River.

While fire officials said foam is more effective than water in extinguishing petroleum fires, the product could come with drawbacks, the Environmental Protection Agency warns, and some residents expressed concern about toxic chemical runoff getting into and polluting the Naugatuck River, a 40-mile stretch of water that carves its way south from northwest Connecticut into the Housatonic Valley and serves as vital watershed for parts of the state.

Officials said some, not all, of the city’s drains lead to the river, which flows through the middle of town. But they don’t foresee major problems with the foam.

The foam, referred to by firefighters as Aqueous Film Forming Foams (AFFFs), acts as a cooling agent, forming on top of burning debris or petroleum.

Environmental and fire officials said the foam, some of which contains man-made chemicals (known as perfluorochemicals or fluorosurfactants), is mostly safe and approved by the Environmental Protection Agency.

But some PFCs have been phased out of production after studies showed they were dangerous to wildlife because they entered groundwater, spread across long distances and remained in the blood for long periods of time, according to the EPA.

PFCs can also cause liver and thyroid problems.

To combat health and environmental concerns, a fire official said, most departments now use a Class A expanding foam that’s biodegradeable.

The potency is low, at about 3 to 6 percent, and is further diluted when mixed with water.

The EPA said current AFFFs are chemically different from those that have been phased out.

The EPA said further study is needed to see whether they’re toxic.

What has local environmental officials more worried is small tire chunks that could get stuck in fish gills, Jeff Chandler, supervisor for Department of Energy and Environmental Protection, said.

The department put booms in the river to sop up runoff, but Chandler said some of it will inevitably find its way into the water.