The hydrogeochemical characteristics of the Cabo de Gata coastal aquifer (southeastern Spain) were studied in an attempt to explain the anomalous salinity of its groundwater. This detritic aquifer is characterised by the presence of waters with highly contrasting salinities; in some cases the salinity exceeds that of seawater. Multivariate analysis of water samples indicates two groups of water (G1 and G2). Group G1 is represented in the upper part of the aquifer, where the proportion of seawater varies between 10 and 60%, whilst G2 waters, taken from the lower part of the aquifer, contain 60−70% seawater. In addition, hydrogeochemical modelling was applied, which reveals that the waters have been subject to evaporation between 25 and 35%. There was a good agreement between the modelled results and the observed water chemistry. This evaporation would have occurred during the Holocene, in a coastal lagoon environment; the resulting brines would have infiltrated into the aquifer and due to their greater density, sunk towards the impermeable base. The characteristics of this water enabled us to reconstruct the interactions that must have occurred between the coastal aquifer and the lagoon, and to identify the environmental conditions that prevailed in the study area during the Middle Holocene.