The Dunedin Fire Service says a part failure caused a gas leak at the Cadbury chocolate factory, forcing it to be evacuated this afternoon.
Emergency services were called to Cadbury World on Cumberland Street shortly before 1.30pm.
The ammonia leak has since been isolated and engineers are working to fix it.
Otago Fire Service area commander Craig Geddes said Cadbury was well prepared for the evacuation.
"We're working closely with on-site engineers that provided us with the technical expertise in isolating the leak, and as a result of their initial investigation, it appears there has been a part failure that has led to the leak."
Staff at the factory were able to return to work.