Burton's Foods, which owns and bakes brands such as Jammie Dodgers and Wagon Wheels, said it was closing its site in Moreton after a business review.
The company said it would invest Â£7m at its manufacturing sites in Edinburgh and Llantarnam, South Wales.
It also plans to consolidate its Knowlsey multi-site distribution operations in a single location.
Burton's Foods intends to phase down production from March before completing the closure later in 2011.
Chief executive Ben Clarke said: "Today's announcements recognise the need to transform our supply chain.
"The proposed job losses are deeply regrettable, but, along with the new Â£25m investment we are making in our UK manufacturing capability, will help deliver sustainable profitable growth for the company in a highly competitive and challenging market."
Angela Eagle, Labour MP for Wallasey, said it was a "huge blow to the community".
"This is the largest private sector employer in the constituency and they have decided to close this plant at a time when the job market is deeply depressed, leaving 342 families struggling after Christmas.
"I will pledge to work during the consultation to persuade them to change this decision."
She added: "Over the years we have given endless support to the plant, injecting public money to keep it going and secure those jobs, and it is a devastating blow that they turn around today and do this to Morton."
Wirral Council leader Councillor Jeff Green said: "I am incredibly disappointed by this proposal and will be seeking an urgent meeting with Burton's to examine and discuss the reason behind their decision.
"I also wish to investigate whatever opportunities there are to continue to work with the company to secure jobs in Wirral and the future of the site."
The Unite union's national officer Jennie Formby said: "Burton's has been part of the Wirral for generations, providing stable employment for families across the community.
"So we will fight with all our power to save this plant because closure is not an option. It will devastate this community."
Edinburgh MSP David McLetchie has welcomed the announcement of further investment at Burton's Sighthill factory, which has more than 600 permanent and 250 agency staff.
Mr McLetchie said: "This is great news for the Sighthill workers as well as a huge relief, because when Burton's announced this review of its facilities across the UK back in October there was a distinct possibility that Sighthill could be closed or seriously run down."
Burton's Foods, which makes branded and own-label biscuits and snacks, is the second largest biscuit supplier in the UK.
As well as Wagon Wheels and Jammie Dodgers, it also makes Cadbury's chocolate biscuits including the Crunchie, Turkish Delight and Caramel biscuit ranges.
A biscuit manufacturer is to close its Wirral factory, with the loss of 342 jobs.