Confectionery giant Cadbury Schweppes has said the salmonella contamination at one of its production plants will cost it about £20m ($37.5m) this year.
Half of the sum relates to the cost of recalling one million chocolate bars, while the rest comes from advertising costs and "manufacturing improvements".
Cadbury said it was "truly sorry" for the concern the contamination had caused to its customers.
The news came as the firm announced a 20% rise in pre-tax profits.
The world's largest confectionery firm reported profits in the six months to 30 June of £402m.
Shares in Cadbury closed up more than 3% at 537.5 pence by the end of trade on the London Stock Exchange.
Cadbury performed well in the Americas and Asia, but said it had a "challenging" start to the year in Europe - particularly the UK - where the market was weak.
The company withdrew a million bars in June after a pipe at its plant in Marlbrook, Herefordshire, caused salmonella contamination.
Chief executive Todd Stitzer told the BBC that consumer confidence in the firm's products had been hit by the product recall, with Cadbury's market share down by about one percentage point.
"The quality assurance process that we used in our manufacturing has caused our consumers concern and we are truly sorry for that," he said.
A report commissioned by the government's Food Standards Agency found that Cadbury was using an out-of-date approach to risk assessment and product testing for salmonella contamination.
The firm first found traces salmonella in some of its best known chocolate bars in January, but it was not until six months later that it decided to tell the health authorities.
A number of people have said they are considering legal action against Cadbury, claiming to have contracted salmonella poisoning from one of its chocolate bars.
The Health Protection Agency has said there has been an outbreak of the Montevideo strain of the salmonella bug, but it added that the source of the outbreak had not been identified.
Mr Stitzer admitted that "we are living in litigious times", but added that Cadbury would try to "work through" any issues with consumers.
William Grobel, a consultant at brand valuation agency Intangible Business, said the salmonella incident was unlikely to have any long-term implications for Cadbury and its brands.
"The £20m hit and loss of 1% market share was not because consumers didn't want to buy the products but because they couldn't - they had been removed from the shelves," he said.
"Brands are more resilient than reputation and it will take some doing to dislodge a brand that has been the nation's favourite for 150 years."
The seven brands affected by the product recall were the 250g Dairy Milk Turkish, Dairy Milk Caramel and Dairy Milk Mint bars, the Dairy Milk 8 chunk and the 1kg Dairy Milk bar as well as the 105g Dairy Milk Buttons Easter Egg and the Freddo bar.
Mr Stitzer said that Cadbury would be launching a major advertising campaign and a series of new chocolate products in the UK, including a dark chocolate Flake and a lighter bar called Cadbury Highlights Chocolate.