Thames Water has been fined a record £20.3 million for polluting the River Thames with 1.4 billion litres of raw sewage.
The company allowed huge amounts of untreated effluent to enter the waterway in Oxfordshire and Buckinghamshire in 2013 and 2014, leaving people and animals ill, and killing thousands of fish.
The fine, which amounts to about two weeks' profits for the privatised utility, is 10 times the previous largest fine for a water company for an environmental disaster.
It followed a Court of Appeal ruling in March 2016 that big commercial organisations which cause environmental pollution can be ordered to pay fines running into tens of millions of pounds.
Ordering Thames to pay £20,361,140 at a sentencing hearing at Aylesbury Crown Court on Wednesday, Judge Francis Sheridan criticised the utility for presiding over a "shocking and disgraceful state of affairs".
He condemned the firm's "history of non-compliance", saying: "It should not be cheaper to offend than to take appropriate precautions."
He added: "Logbook entries reflected the pathetic state of affairs and the frustration of employees.
"Thames Water continually failed to report to the Environment Agency despite (managers) being fully aware of the issues and reporting governance."
He said the firm's managers had on several occasions ignored warnings and "risks identified by employees and others". In some cases, staff recorded a "failure waiting to happen".
Passing sentence, Judge Sheridan took into account the length of the offending period, inadequate site management and "a continual failure to report incidents".
The firm previously admitted 13 breaches of environmental laws over discharges from sewage treatment works in Aylesbury, Didcot, Henley and Little Marlow, and a pumping station at Littlemore.
It also pleaded guilty to a further charge on March 17 over a lesser discharge from an unmanned sewage treatment plant at Arborfield in Berkshire in September 2013.
The judge also took into account seven further incidents at sewage sites on the Thames in 2014.
Thames's previous record fine for pollution was £1 million, paid in January 2016.
Speaking outside the court on Wednesday, Richard Aylard, Thames Water's external affairs and sustainability director, said: "We have failed in our responsibility to the environment and that hurts both personally and professionally because we do care.
"We've also failed in our responsibility to our customers, who pay us to provide an essential public service all the time, every day, and not just some of the time, and we apologise for all of those failings.
"But in the three years since the last of those incidents we have learnt our lesson - there have been sweeping, far-reaching changes across the waste water business.
"That has included more people, more and better systems and more investments, and that is beginning to pay off.
"Our performance has improved considerably and we're also doing a lot of work which we're proud of in partnership with environmental groups across our area, working to improve rivers and not just get them back to where they should be."
He insisted customers would not face an increase in prices, adding: "This fine will be paid in full by shareholders only."
Anne Brosnan, the Environment Agency's chief prosecutor, said: "Thames Water was completely negligent to the environmental dangers created by the parlous state of its works.
"Our investigation revealed that we were dealing with a pattern of unprecedented pollution incidents which could have been avoided if Thames Water had been open and frank with the Environment Agency as required by water company industry protocol."
The agency's chief executive Sir James Bevan added: "This case sends a clear signal to the industry that safeguarding the environment is not an optional extra, it is an essential part of how all companies must now operate."
Consumer groups and charities welcomed the fine.
Sir Tony Redmond, the London and South East chairman of the Consumer Council for Water, said: "These were extremely serious and unacceptable failings by Thames Water which had a devastating impact on the natural environment.
"We believe a fine of this magnitude sends a very clear message to the company that it needs to take seriously its environmental responsibilities.
"Thames Water says it has learned lessons and we'll be watching closely to make sure it acts on these."
Rose O'Neil, water policy manager at WWF, added: "This ruling and fine is welcome and needs to focus the minds of all water companies and their shareholders as it is not an isolated issue.
"This case highlights the need for water companies to invest in solutions that manage the whole local catchment area such as green infrastructure and sustainable drainage systems.
"They simply can't continue treating our rivers as their dumping ground."