Nestlé has announced it is to switch the manufacturing of Smarties from its factory in York to a factory in Germany by the end of the year with the loss of more than 600 jobs.

The move comes just two weeks after Cadbury announced it would be moving production of some of its most famous lines to a plant in Poland and shedding 700 jobs in the UK in a bid to cut costs.

Nestlé Rowntree said it was moving production over to Hamburg as part of a shake-up of its York operation, which is expected to lead to the loss of 645 jobs and introduction of new terms and conditions for remaining workers.

Smarties is the latest brand to leave the plant, where they have been made since 1937. Black Magic is now made in the Czech Republic and Dairy Box was transferred to a plant in Spain earlier this year.

Nestlé confirmed that several of the company's key products, such as KitKat and Aero, will continue to be made in York following the restructure.

"This is part of the company's planned changes to the York factory, announced last September, which include a £20m investment to expand the site's state-of-the-art facilities and safeguard long-term employment for more than 1,800 employees," said a Nestlé spokesman.

The company plans to sell off 40% of the York site to fund work in the remaining sections of the factory. The most "significant" buildings will be kept, according to Nestlé.

Planning applications are expected to be submitted to the City of York Council next spring.