The ecology and mating system of two populations of the peacock blenny Salaria pavo that have been reported to differ in sexual behaviour were studied. In the Gulf of Trieste, a northern Adriatic Sea population lives in rocky shores, whilst in the Ria Formosa, an Atlantic population inhabits a coastal lagoon with sandy barrier islands. In the Gulf of Trieste, nest availability was found to be higher and nest aggregation lower than in Ria Formosa. Nesting males courted females more and in higher proportion, and inversely, females directed less courtship displays towards nest holders in the Gulf of Trieste than in Ria Formosa. The relative frequency of small female-like males that reproduce by parasitically fertilizing eggs in the larger males' nests was lower in the Gulf of Trieste population. This variation in the sexual behaviour of nesting males and females is likely to reflect a plastic behavioural response to the varying ecological conditions. The difference between populations in the relative frequency of parasitic males suggests that the male alternative reproductive tactics are condition-dependent.