Water firm United Utilities has been ordered to pay a £300,000 fine and £150,000 costs in connection with the cryptosporidium outbreak that affected thousands of homes in Lancashire in 2015.
The source of the outbreak was due to structural defects at Barnacre reservoir - which may have allowed contamination from farm animal faeces through the roof-to-wall joints of a reservoir structure after a heavy downpour.
At the time the Franklaw treatment works near Garstang was temporarily introducing water from the Barnacre reservoir due its usual source, a coastal reservoir, having maintenance work.
But the court heard no risk assessment about using the water from the Barnacre reservoir, which is in a rural environment, was done - and the contaminated water was introduced into the Franklaw site at a stage of the process AFTER the usual process to remove cryptosporidium.
The company pleaded guilty to supplying water to premises from the Franklaw Water Treatment Works at Catterall, Garstang, that was unfit for human consumption between July 30 and August 18, 2015.
Two further charges of failing to disinfect water used for domestic purposes, and failing to design and continuously operate an adequate treatment process were withdrawn.
The Honorary Recorder of Preston, Judge Mark Brown, said it was the largest event of its kind since the privatisation of the water industry and had a major impact on day-to-day water consumption.
Prosecuting for the Drinking Water Inspectorate (DWI), Richard Banwell said cryptosporidium had "found its way" into a service reservoir that was holding treated water for supply, and that water was also used for treatment of water.
Franklaw treatment works in Catterall had temporarily switched its operation to supply water from the Barnacre reservoir to allow planned maintenance to be carried out on a 33 inch coast aqueduct pipe used to carry out water towards coastal areas - but no risk assessment was carried out.
Mr Banwell described it as a "significant change" to the operation of Franklaw, which meant processed water was taken from Barnacre reservoir for a short period while the repairs were carried out, from July 27 to 31, 2015.
He added: "But that change in how Franklaw was operating, the redirection of water back into the works, was not subject to a risk assessment.
"The risk assessment for Barnacre service reservoir appears also to have been inadequate when assessing hazards and risks inherent to its location."
The court heard the reservoir was underground, but as it is in a rural area it had "inherent hazards" from the surrounding environment, and structural defects had allowed in cryptosporidium, possibly from the faeces of farm animals.
He added: "There is a filter that is routinely located to sample treated water leaving Franklaw - all water going through the South aqueduct. It is a large foam pad and it is some diameter.
"When the pad was tested in the firm's own lab it was found cryptosporidium was present.
"Wider sampling then took place because the replacement filter was tested immediately and that was found also to have cryptosporidium present.
"Once the oocysts (parasite) are identified there is a need to carry out further tests to identify the species of cryptosporidium present. That's because not all species are pathogenic to humans.
"In this case there were samples of of oocysts that were pathogenic - harmful to humans."
Cryptosporidium is a microscopic parasite that causes the diarrheal disease cryptosporidiosis.
The court heard the firm notified DWI and Public Health England and began the search for potential sources.
However, the firm was criticised after it emerged a direction for the public to boil all their water was not given until 3.30pm on August 6, despite the alarm being raised.
The works was "offline" for routine maintenance on August 5 into 6, but it came back into service at 11am on August 6 and continued to supply water to the public for around four hours before the boil water precautionary advice was given by the company at around 3.15pm. "
Investigations were then carried out. leading the probe to the Barnacre reservoir, which is next to Burns Farm, in September 2015.
Samples were taken from the environment around and "ingress" was found along the roof-to-wall joints of the reservoir pipe.
The court was told dentists had made statements about the effect of the subsequent boiling water rule put in place across Lancashire, with around 100 procedures having to be cancelled, and the operation of dental drills - some using seven litres of water - affected.
The company deployed ultraviolet radiation at strategic points to kill the bug and mitigate the risk to health.
Chief executive Steve Mogford was present in court along with other senior staff at the company.
Defending, Lisa Roberts QC said the firm wanted to demonstrate it "takes its responsibilities to its customers extremely seriously" and "puts safety at the forefront of everything it does."
She accepted there was "understandable consternation" in the community that the source of the outbreak had not been forthcoming until today, but said the firm had supported the DWI and had agreed to co-operate and not to divulge publicly the source.
The company had paid £18.3m in voluntary compensation to consumers, as well as spending £5m on additional costs such as water coolers in schools and bottles of water for vulnerable people.
She added: "United Utilities will be writing to all affected customers to explain the situation. Everyone will receive a letter to explain the situation, households and businesses alike.
"The advice put into place was within hours. The alternative was switching the taps off and that would mean 750,000 people without water. It was felt the boiled water advice would only be in place for a few days.
The firm has 28 days to pay the fine.
Robert Light, Northern Region Chair for the Consumer Council for Water, said:
"We are disappointed that serious failings by United Utilities led to such significant disruption to their customers. The company must now rebuild trust with its customers by explaining what it is doing to prevent any similar incident happening again. We will be closely monitoring them to ensure all recommendations from this incident are already or will swiftly be implemented.
Mr Light said the case had lessons for all water companies, not just United Utilities.
He added: "We expect every water company to consider the findings of the Drinking Water Inspectorate's report and address any relevant recommendations swiftly to ensure any potential risk to customers is reduced. As the water customer watchdog we will ensure that this is the case.
“We welcome United Utilities’ offer to share all the issues from this incident with other companies and will work with them to ensure this happens”.