Thousands of homes, a prison and a hospital had their water supply shut off after a Perthshire burn was polluted.
Public health fears forced Scottish Water to close off an intake to the drinking water supply after fertiliser got into two waterways near Bankfoot.
The intake in question supplied around 52,000 homes and food manufacturers, in addition to the hospital and prison.
The pollution was also responsible for the death of fish and other animals in the water system.
At Perth Sheriff Court on Thursday, a Lanark firm and its operations manager were accused of causing the incident.
Andrew Bailie and Digestate Management Services Ltd are alleged to have allowed fertiliser to enter the Ordie Burn and an unnamed tributary of the nearby Wynnie Burn while spreading in September 2015.
The charge states that between September 21 and 23 at Little Tulliebelton Farm, near Bankfoot, they caused serious environmental harm by discharging fertiliser while spreading.
This was alleged to have had a serious environmental impact, which killed fish and caused Scottish Water to close a drinking water supply intake serving a local population of 52,000 and various public buildings and companies.
It is further alleged that on the same dates they discharged an “anaerobic digestate” into the burns on three occasions without authority, and that they breached rules by storing fertiliser within 10 metres of a waterway.
Both 37-year-old Bailie, also of Lanark, and Digestate Management Services deny the charges.