The pollution had ended up on a beach after the treatment works were flooded.