The UK is being taken to court by the European Commission over a failure to ensure waste water from towns, cities and villages is properly treated.
The case relates to 17 areas where the collection and treatment of waste water from homes, industry and rainwater is inadequate or does not meet stringent standards needed where the water ends up in sensitive areas such as lakes and estuaries.
EU countries have had many years to ensure that urban waste water is properly treated to prevent risks to human health, inland waters and sea environments, the commission said.
In four areas, Banchory, Aberdeenshire; Stranraer, Dumfries and Galloway; Ballycastle in Co Antrim; and Clacton, Essex, the commission said water treatment is inadequate, while in Gibraltar there was no treatment plant at all.
And in 10 areas where the waste water discharges into freshwater sites and estuaries, existing treatment does not meet the stringent standards for sensitive areas.
These are Lidsey, West Sussex; Tiverton, Devon; Durham; Chester-le-Street; Winchester, Hampshire; Islip, Oxfordshire; Broughton Astley, Leicestershire; Chilton (also known as Windlestone), County Durham; Witham and Chelmsford in Essex.
The case also involves excessive spills from storm waste overflows in drainage systems serving Llanelli and Gowerton, South Wales.
Speaking about the situation in England, a spokeswoman for the Department for Environment, Food and Rural Affairs (Defra) said: "It is encouraging that 98% of waste water plants are now a good standard and we are working hard to improve the rest.
"Working with water companies, we have secured around £13.5 billion to improve infrastructure and are confident that we will be able to make the necessary improvements to get all treatment plants up to the EU standard by 2016."