The fire in Santos spread toxic gas over the country's biggest port and across four cities.
The company owners said the containers were full of acid and a disinfectant which came into contact with rainwater, causing a reaction.
Reports say close to 200 people in three cities were taken to hospital with breathing difficulties.
Prosecutors are now investigating whether anyone is to blame for the fire, that more than 300 firefighters battled at its peak.
The container terminal was operated by Localfrio, a logistics company, in Guaruja, a municipality on the eastern side of Santos, in Sao Paulo state.
A spokeswoman for the company, which exports chemicals used for refrigeration and general cargo, said the containers were filled with chloric acid and sodium dichloroisocyanurate - a cleaning and disinfectant agent. Read more on bbc.