A water company has been fined £300,000 after drinking supplies were contaminated with a parasite.
Animal waste seeped into an underground tank and contaminated the water with cryptosporidium at Franklaw treatment works in 2015, the prosecution claimed.
United Utilities admitted supplying water unfit for human consumption after up to 700,000 people were left unable to drink tap water for three weeks.
Chief executive Steve Mogford said the company has "learned valuable lessons".
The underground reservoir's risk assessment was "inadequate", Preston Crown Court was told.
Sentencing, Judge Mark Brown said it was "the largest event of its kind since the privatisation of the water industry many years ago" and it had "a major impact on day-to-day water consumption".
He said the fine should act as a "deterrent".
The chief inspector at the Drinking Water Inspectorate (DWI), which brought the prosecution, said the company failed "to take appropriate and rapid action to protect consumers when the contamination was known".
Marcus Rink said United Utilities failed to follow nationally recognised good practice.
United Utilities normally took water from its coastal aqueduct, the court heard.
When that aqueduct was being repaired, the company decided to use a supply from underground storage tanks at its Barnacre site.
The court heard a "structural defect" at the site had allowed a parasite to seep in to the tank and water had been infected with the cryptosporidium bug.
Cryptosporidium was found during routine tests on 6 August 2015.
It can cause diarrhoea and abdominal cramps if ingested.
People in Blackpool, Chorley, Fylde, Preston, South Ribble and Wyre were affected.
The court heard there was no outbreak of illness as a result of the contamination but there was an increase in patients attending GP surgeries, thought to be a result of press coverage.
Following the sentencing, Mr Mogford apologised and said "public safety is always our primary concern".
"We have learned valuable lessons from what happened and have put technology and processes in place to guard against a repeat of this type of incident," he said.
Fifteen ultraviolet irradiation units, which kill bacteria and bugs like cryptosporidium, have since been installed in the region.
United Utilities earlier expressed "deep regret" at the incident and said it had spent £25m as a result of the contamination, including paying £18.3m in voluntary compensation to households and businesses affected.
The company, which has an annual turnover of £1.7bn, was also ordered to pay £150,000 costs.
MP for Preston Mark Hendrick tweeted that "£300,000 on a turnover of £1.7bn is a pathetic fine".