The fire caused significant damage to the port and destroyed at least four warehouses, but no injuries were reported by authorities.
According to initial investigations, the fire started at 12:30 am on Wednesday among a cluster of warehouses in the port area.
It is not yet clear what caused the initial explosion, which created a plume of black smoke over the city.
Sixteen fire crews attended the incident, including from the nearby towns of Macerata and Pesaro.
“The fire itself is under control, the firefighters have managed to contain it and prevent it from spreading to other buildings, plants, companies and other nearby activities,” Ancona Mayor Valeria Mancinelli said on Facebook on Wednesday morning.
Authorities had said that it would be a “long operation” to completely extinguish the fire due to difficulties in reaching the worst affected areas.
Authorities had closed all schools, universities, parks and outdoor sports facilities as a precaution, pending analysis and indications from the health experts.
Citizens were also advised to limit their movements and close building windows.
“At the moment we have no indication about the alleged toxicity of the plume,” Mancinelli said.
“Please avoid the circulation of unreliable news that can only generate confusion.”