Abstract The investigated section of the Lower Devonian La Vid Group (Cantabrian Zone, northern Spain) was deposited in a rifted-continental-margin setting, which in the Carboniferous evolved into a foreland basin, affected by Variscan thin-skinned folding and thrusting. Soon thereafter the originally linear orogenic belt underwent secondary curvature, forming the Variscan Ibero–Armorican Arc. This bending caused extension, crustal thinning, and strike-slip movements in the outer part of the orocline, to which the area of our investigation belongs. Subsequently the Variscan orogen subsided in Mesozoic and Cenozoic times, was covered by sediments of unknown thickness, and was affected by Alpidic tectonics. The Paleozoic Cantabrian Basin is an outcrop analogue for kilometer-scale differences in type and degree of porosity and cementation that can be expected in foreland basins of other areas as well. Origin of cements and related fluids in the La Vid carbonates can be described by three distinct fluid-evolution mechanisms: local in-situ fluid generation, mixing of external with internally generated fluids, and incursion of exotic fluids. The oldest recorded fluid belongs to the basin stage in pre-Variscan times. Upward migration of an in-situ generated fluid from underlying organic-rich shales through iron-rich sandstones into the carbonates of the La Vid Group was accompanied by the precipitation of various Fe-carbonates in various stratigraphic positions of this succession. Among the cements are ferroan saddle dolomites with inclusions of solid bitumen in the lower part and mature petroleum in the upper part of the succession. Assuming a common origin of petroleum and aqueous fluid inclusions in the ferroan saddle dolomite, trapping conditions of 114 to 130°C and a pressure of about 38.5 to 40.5 MPa were determined; this corresponds to a burial depth of about 3850 to 4050 m. The second important fluid event exhibits mixing of a low-salinity internally generated local fluid with an exotic high-salinity fluid of widespread occurrence. This fluid is attributed to the time of Variscan orogenesis, probably the formation of the Cantabrian orocline, based on several tectonic features occurring in the cements. Clear saddle dolomite precipitated during this fluid event in the dolostone unit of the La Vid Group only. These dolomites exhibit a distribution of zoned fluid inclusions from low salinity in the cores to high salinity in the outer parts of the crystals. Minimum trapping temperatures are 160 to 170°C at the core and temperatures of 110 to 120°C at the rim. Higher temperatures in the rim (up to 210°C) appear to have resulted from post-entrapment reequilibration (stretching) of the inclusions during Variscan deformation. The last cementation phase was caused by a cool and oxidizing fluid, related to tectonic activity, most probably of Alpidic age. This fluid precipitated calcite, celestite, and kaolinite and recrystallized former Fe-carbonate cements to calcite and to Fe-oxyhydroxides. Fluid inclusions in celestite have low salinities, ruling out basinal brines and pointing to a meteoric or marine origin. Occurrences of these cements in various locations all over the Cantabrian Zone imply a large-scale fluid event.