In defence of their nests or territories, damselfish (Pomacentridae) attack even large and potentially dangerous intruders. The Indo-Pacific region contains many species of sea snakes, some of which eat damselfish whereas others do not. Can the fishes identify which sea snake taxa pose a threat? We recorded responses of damselfishes to natural encounters with five species of snakes in two shallow bays near Noumea, New Caledonia. Attacks by fishes were performed mostly by demersal territorial species of damselfish, and were non-random with respect to the species, size, sex and colouration of the snakes involved. The most common target of attack was Emydocephalus annulatus, a specialist egg-eater that poses no danger to adult fishes. Individuals of a generalist predator (Aipysurus duboisii) that were melanic (and thus resembled E. annulatus in colour) attracted more attacks than did paler individuals. Larger faster-swimming snake species (Aipysurus laevis, Laticauda saintgironsi) were watched but not attacked, or were actively avoided (Hydrophis major), even though only one of these species (A. laevis) eats pomacentrids. Attacks were more common towards female snakes rather than males, likely reflecting slower swimming speeds in females. In summary, damselfishes distinguish between sea snake species using cues such as size, colour and behaviour, but the fishes sometimes make mistakes.