A "widespread mice infestation" was discovered at an Asda bakery after a live mouse was found on a baking tray and droppings next to a cookie.
The company was landed with a £700,000 fine, has since apologised, and has since spent £17,000 on pest proofing works at the affected store.
Environmental Health Officers, acting on a tip-off, were confronted by grim scenes at the Bromborough supermarket's in-store bakery.
Wirral Council later prosecuted the company, which admitted two breaches of the Food Safety and Hygiene regulations 2013 at Liverpool Magistrates' Court.
Nigel Lawrence, QC, prosecuting on behalf of the council, said inspectors received the tip off on October 28, 2015, and headed immediately to the Asda on Welton Road.
The court heard the inspectors began by looking at pest control logs, which showed reports of mice activity in the store going back to September.
Mice droppings were found in various places in the in-store bakery
Mr Lawrence said: "Mouse droppings were found to be evident under shelving, under a water cooler, below metal storage cages and on the bottom of a cooling rack.
"Officers also witnessed a live mouse on a baking tray on the cooling racks in the bakery.
"They also discovered a mouse dropping on a baking tray right next to a cooling cookie, directly posing a risk of physical and microbial contamination to food."
The court heard management agreed to close the in-store bakery voluntarily and advice was given on disinfection and cleaning the premises.
Inspectors found evidence of a mouse infestation
Officers returned the following day and found a live mouse caught in a sticky trap in an electrical cabinet of the bakery, as well as a dead mouse and droppings in the warehouse.
The bakery was give the go-ahead to re-open on October 30, but officers returned on November 5 to find droppings at the bottom of a cooling rack below a tray of finger rolls.
Droppings were found throughout the bakery, and Mr Lawrence said officers expressed their "grave concerns" about the situation to management.
The court heard by November 20, a pest control technician from City Facilities Management Ltd told the officers he believed "he had got the better of the mice rather than vice versa".
Mr Lawrence said mice droppings can contain potentially fatal diseases including certain strains of Meningitis , Salmonella and Campylobacter.
Asda was fined £700,000 over conditions at its Bromborough store
He told the court: "The bakery at the defendant's store was in a dirty and contaminated state. These conditions had clearly existed for some time.
"Food was clearly put directly at risk, as were all areas, surfaces and apparatus within the bakery and in the warehouse.
"The evidence of widespread mice infestation was clear and obvious. The defendant, through its employees, was aware of the problem for some time.
"The problems with contamination must have been known about by staff, but the position just carried on. Equally the risks that such infestation posed were, or should have been, obvious."
Jonathan Goulding, representing Asda, told the court his client accepted its own national guidelines on food safety and pest control had not been followed at the Bromborough store.
He said: "Asda apologises sincerely for what happened at the store, conditions were not as they should have been and what we would like despite a very considerable investment in pest controlling services.
"A very great deal of work has been done to ensure it does not happen again. Asda is genuinely regretful."
Environmental Health Officers found droppings in the infested in-store bakery
Mr Goulding said the general store manager had been given a formal warning for "failing to escalate" the problem.
District judge Wendy Lloyd, passing sentence, said while she accepted there was no evidence of anyone being harmed by the infestation, she ruled that the risk was high.
She said: "The risks are particularly high for the elderly, the very young, or those who are immune suppressed.
"Buying bread or baked foodstuffs from a store as known as Asda; the public should have no reason to think they were taking a risk."
Judge Lloyd described the "slow" response from Asda after the initial inspection as "bewilderingly inadequate".
However she accepted that the company had co-operated and done considerable pest-proofing work at the Bromborough store.
Asda was also ordered to pay £34,856 in investigation and legal costs and a £170 victim surcharge.