A water company has been fined £1.1m for discharging sewage into the River Ouse near York.
Yorkshire Water Services Ltd had previously admitted three environmental offences relating to its treatment works at Naburn near York.
The Environment Agency, which brought the case, said sewage could be seen in the water.
Yorkshire Water Services Ltd said it accepted the judgement and apologised for the incident.
Mike Riby, from the Environment Agency, said the pollution "had an impact on the quality of the water in the Ouse, affecting up to a kilometre of the river."
Yorkshire Water said: "In response to this incident, we have carried out a full investigation at Naburn waste water treatment works and taken action to prevent a repeat occurrence."
This included installing an alarm system to warn of potential overflows and increasing the number of staff.
In addition to a fine of £1.1m fine the company was ordered to pay costs of £27,000 at Leeds Crown Court.