Salinity is one of the most important drivers of the distribution, abundance and diversity of organisms. Previous studies on the evolution of saline tolerance have been mainly centred on marine and terrestrial organisms, while lineages inhabiting inland waters remain largely unexplored. This is despite the fact that these systems include a much broader range of salinities, going from freshwater to more than six times the salinity of the sea (i.e. >200 g/L). Here, we study the pattern and timing of the evolution of the tolerance to salinity in an inland aquatic lineage of water beetles (Enochrus species of the subgenus Lumetus, family Hydrophilidae), with the general aim of understanding the mechanisms by which it was achieved. Using a time-calibrated phylogeny built from five mitochondrial and two nuclear genes and information about the salinity tolerance and geographical distribution of the species, we found that salinity tolerance appeared multiple times associated with periods of global aridification. We found evidence of some accelerated transitions from freshwater directly to high salinities, as reconstructed with extant lineages. This, together with the strong positive correlation found between salinity tolerance and aridity of the habitats in which species are found, suggests that tolerance to salinity may be based on a co-opted mechanism developed originally for drought resistance.