Petrographic and geochemical studies of an Upper Eocene reef and associated basinal sediments from the mixed carbonate–siliciclastic fill of the south-eastern Pyrenean foreland basin near Igualada (NE Spain) provide new insights into the evolution of subsurface hydrology during the restriction of a marine basin. The reef deposits are located on delta-lobe sandstones and prodelta marls, which are overlain by hypersaline carbonates and Upper Eocene evaporites. Authigenic celestite (SrSO4) is an important component in the observed diagenetic sequences. Celestite is a significant palaeohydrological indicator because its low solubility constrains transportation of Sr2+ and SO42− in the same diagenetic fluid. Stable isotopic analyses of carbonates in the reef indicate that meteoric recharge was responsible for aragonite stabilization and calcite cementation. Sulphur and oxygen isotope geochemistry of the celestite demonstrates that it formed from residual sulphate after bacterial sulphate reduction, but also requires that there was a prior episode of sulphate recycling. Meteoric water reaching the reef and basinal areas was most probably charged with SO42− from the dissolution of younger Upper Eocene marine evaporites. This sulphate, combined with organic matter present in the sediments, fuelled bacterial sulphate reduction in the meteoric palaeoaquifer. Strontium for celestite precipitation was partly derived in situ from dissolution of aragonite corals in the reef and basinal counterparts. However, 87Sr/86Sr data also suggest that Sr2+ was partly derived from dissolution of overlying evaporites. Mixing of these two fluids promoted celestite formation. The carbonate stable isotopic data suggest that the local meteoric water was enriched in 18O compared with that responsible for stabilization of other reefs along the basin margin. Furthermore, meteoric recharge at Igualada post-dated evaporite deposition in the basin, whereas other parts of the same reef complex were stabilized before evaporite formation. This discrepancy resulted from the spatial distribution of continental siliciclastic units that acted as groundwater conduits.