AbstractAim To analyse the relationship between fish species richness and salinity, and to provide a simple linear model for fish diversity trends across salinity gradients in a tropical coastal lagoon that can be compared with other similar ecosystems and other communities. To reinforce our conclusions, the salinity–fish richness relationship was investigated at different spatial scales (sampling station, set of stations and whole lagoon) and for two different periods, separated by 18 years.Location The Terminos coastal lagoon, a shallow tropical lagoon (mean maximum depths ranging between 3.5 and 4.5 m), is located in the southern Gulf of Mexico (18.5–18.8° N, 91.3–91.9° W). The lagoon is 70 km long and 30 km wide, with a surface area of 1700 km2.Methods Fish sampling, individual identification to the species level, and environmental variable measurements were carried out monthly at 17 sampling points. Multiple regression analysis with a backward selection procedure was used to relate fish species richness to environmental variables. Other statistical techniques, including cluster analysis and ancova, were applied to experimental data surveys.Results Among the different environmental variables, salinity was significantly and consistently related to fish species richness, whatever the period and the scale of observation. We found mainly significant negative correlations (P < 0.05) between fish species richness and salinity when sampling stations were analysed individually, and particularly for the river runoff zones with high variation in salinity throughout the year. For the entire lagoon, robust negative linear models were observed when fish species richness was organized into salinity ranges, with salinity explaining c. 8% of the variation in mean fish species richness (in a multiple regression analysis; 63–93% when considered in isolation).Main conclusions In the Terminos lagoon the relationship between fish species richness and salinity is mainly negative on any spatial scale. This result may be due partially to the penetration of freshwater fishes into estuarine areas following freshwater discharges, and partially to the dominance of estuarine taxa more able to tolerate low than high salinity values. Finally, we suggest that the ‘realized’ ecotone, where species from different origins really mix, is situated between 5 and 10‰, corresponding to the highest fish richness.