One in four of Scotland's beaches are in a "poor" state because of toxic contamination from sewage and animal waste.

The Scottish Environment Protection Agency (Sepa) has rated 21 bathing waters bottom under tough new European safety standards, meaning swimmers have to beware of bacteria and viruses.

Six given the poor marks are in Ayrshire, four in Dumfries and Galloway, and three around the Moray Firth. Two are in Aberdeenshire, two in East Lothian, and one each in Edinburgh, Angus, Fife and the Scottish Borders.

Seven of the beaches badly polluted by overflowing sewers and animal faeces have previously been given Seaside Awards by the government-backed charity, Keep Scotland Beautiful. One of the reasons for winning the awards is said to be "good water quality".

But the campaign group, Surfers Against Sewage, pointed out that the award-winning bathing waters were so dirty that bathers had a one in seven chance of contracting gastroenteritis. It would be a "mistake" to suggest that they were clean, safe or had good water quality, argued the group's Andy Cummins.

"The tougher standards have been introduced to offer the public better protection against a wide array of significant health risks," he said. "Those beaches that fail urgently need to adopt new actions and measures to ensure water quality is safe for the public."

This year is the first time that the 2006 European directive on bathing water standards comes fully into force. It is much stricter than the previous 1976 directive, which has guided safety limits until now.

Under the new directive, Scotland's 84 officially designated bathing waters are tested over four years for bacteria linked to human and animal wastes, E Coli and intestinal enterococci. The contamination can cause ear, nose, throat and stomach infections and, in extreme cases, be fatal.

As well as the 21 beaches classed as poor, a further 13 across Scotland are rated as just "sufficient". Nine of those have also been given Seaside Awards by Keep Scotland Beautiful.

However, 22 beaches are rated at excellent, including Pencil Beach at Largs in North Ayrshire, Gullane Bents in East Lothian, Ruby Bay at Elie in Fife, Broughty Ferry in Dundee and Achmelvich, near Lochinver in Highland (see tables).

The Green MSP Alison Johnstone is planning to write to Sepa and local authorities asking why some bathing waters are performing so poorly and what they are doing about it. "We love our beaches but for us to have confidence in them we need clearer information," she said.

Torrential rain is the biggest threat, as it causes diluted sewage to be discharged from the sewerage overflows, and animal faeces to be washed in from farms.