Cadbury has pleaded guilty to three offences under food and hygiene regulations in connection with a salmonella scare last summer.
More than one million chocolate bars were recalled
Birmingham City Council alleged the firm put "unsafe" chocolate on the market for a period in 2006, which led to one million bars being recalled.
Thirty people were affected, the Health Protection Agency said.
Cadbury will be sentenced for the offences at Birmingham Crown Court on 13 July.
Anthony Scrivener QC, indicated the pleas on behalf of the firm during a 10-minute hearing at Birmingham Magistrates' Court.
The company said the bill for dealing with the contamination may reach £30m.
Birmingham City Council is responsible for enforcing health and safety laws at Cadbury's plant in Bournville.
Mr Scrivener told the court that although certain facts in the case were still in dispute, Cadbury accepted its responsibility and would plead guilty to the charges.
He added that they had already spent £20m on improvements.
Cadbury was accused of putting contaminated chocolates on the market between 19 January and 10 March last year.
Other charges include the firm failing to immediately inform relevant authorities about potential dangers and failing to identify "hazards" posed by the salmonella contamination.
Separately Herefordshire Council is also prosecuting the company over the state of its factory near Leominster where the bars originated.
The charges include not keeping a drainage pipe and roof vents in good repair, not permitting adequate cleaning of the premises, inadequate drainage facilities, and not carrying out proper cleaning of the conveyors or storage silos.
Each of the six offences carries a maximum penalty of an unlimited fine and/or two years' imprisonment.
The company is due to appear before Herefordshire Magistrates on 24 July.
'We have apologised'
In a statement released after the hearing in Birmingham, Cadbury said: "Mistakenly, we did not believe that there was a threat to health and thus any requirement to report the incident to the authorities - we accept that this approach was incorrect.
"Quality has always been at the heart of our business, but the process we followed in the UK in this instance was unacceptable.
"We have apologised for this and do so again today."
"The processes that led to this failure ceased from June last year and will never be reinstated."
They added that it was inappropriate to comment on the second set of charges brought by Herefordshire Council.
A major review of global health and safety procedures has since taken place.