Bluff was on alert yesterday as emergency services worked to contain an ammonia leak that at one stage threatened to force an evacuation of the town.
The leak was "successfully contained'' and 70kg of ammonia moved by about 2.30pm.
An 800m exclusion zone was placed around a building at South Port, where the leak was dealt with by 40 firefighters and port service workers.
A HazMat command unit was also on site and police cordoned off the area.
Senior Station Officer Deane Chalmers, of Invercargill, said a fire in a wharf coolstore on Saturday night caused a small leak in an ammonia tank and there were fears it could worsen.
"[It had] the very real potential of escalating into a large-scale leak,'' he said.
"There was quite a sizable amount that could have been released. We knocked [what had leaked] out of the atmosphere by drowning it with water.''
A larger leak would have required the "evacuation of residents'' as most of the town was inside the exclusion zone, but measures were put in place to avoid that, Mr Chalmers said.
Police and the Fire Service urged residents and visitors to keep away from the port area and to stay indoors.
Several fire and port services staff were successfully decontaminated.
"It was a very good result. Just the co-operation of working together with the different agencies,'' he said.
South Port chief executive Mark O'Connor said the fire was in pet food company Wilbur-Ellis' premises.
Senior Sergeant Craig Dinnissen, of Dunedin, said the ammonia was being transferred to another separate tank.
"They [had] concerns that it [the fire] may have compromised the tank,'' he said.
The transfer had not been expected to take as long as it had but it was "a slow process''.
Fire communications shift manager Tim Reynolds said the commercial building was "well alight'' when two fire appliances arrived from Bluff about 11.30pm.
There were no reports of injuries.
A fire investigator from Dunedin visited the site yesterday but was unable to complete the investigation and would be on site again today.