The axe will fall on the Cadbury Dunedin factory, with the company confirming a closing date following "detailed consultation".
It has left the union which represents workers, E tu, "extremely disappointed".
News of the proposed closure of the city's fourth-largest employer came in mid-February which threatened up to 362 jobs.
It caused protests from the community which said the announcement was "out of the blue".
Mondelez International, Cadbury's parent company, on Friday confirmed the factory will end operations in early 2018.
"Following four weeks of detailed consultation with the union and employees, no viable alternative was found to ensure the ongoing sustainable operation of the factory," it said.
The company says their focus now will be "on helping our team and minimising the impact of this decision on them and the broader Dunedin community".
Mayor Dave Cull says he's "extremely disappointed and saddened" by the decision and maintains it was "misguided and wrong".
"The Cadbury factory is efficient and profitable, with a highly skilled and loyal workforce. I believe Mondelez has underestimated the contribution of our city to their success and they will ultimately regret this decision."
E tu strategic director of food Neville Donaldson says the closure will be a "bitter blow" for its members and for the city whose lifeblood, for the most part, was the factory.
"This is a sad day for those loyal, high-performing workers who will lose their jobs. It is also bad news for the people of Dunedin. These are high-value jobs, and an export business which is disappearing."
But there was some bittersweet news in the Mondelez International is considering future production of some "key Cadbury lines" including chocolate fish, Jaffas, Pineapple Lumps and some marshmallow products.
The company has agreed to be part of a working party, which will include Mr Cull, to look at options to stay in New Zealand to some degree.
Mr Donaldson believes it could lead to a new cooperative or new manufacturer under contract to Mondelez International.
Jobs created by the possible new venture would first go to redundant Cadbury workers.
More jobs are also likely to be created at Cadbury World which is currently under re-development which redundant workers will get first pick at.
Mondelez International says it is committed to keeping on as many empoloyees as possible, even supporting them in applying for jobs in Australia or in the wider region.
It says the future of the factory site - in the city centre - will be of great interest to the public and the company will work with the business community to develop it to "support the community and economy".