Wetlands are productive ecosystems that play an important role in the Earth's carbon cycle and thus global carbon budgets. Climate variability affects amount of material entering and the metabolic balance of wetlands, thereby modifying carbon dynamics. This study presents spatiotemporal changes in air‐water CO2 exchange in the vast wetlands of Doñana (Spain) in relation to different hydrological cycles. Water sources feeding Doñana, including groundwater and streams, ultimately depend on the fluctuating balance between annual precipitation and evapotranspiration. Hence, in order to examine the contribution of the rainfall pattern to the emission/capture of CO2 by a range of aquatic habitats in Doñana, we took monthly measurements during severely wet, dry, and normal hydrological years (2010–2013). During wet hydrological cycles, CO2 outgassing from flooded marshes markedly decreased in comparison to that observed during subsequent dry‐normal cycles, with mean values of 25.84 ± 19 and 5.2 ± 8 mmol m−2 d−1, respectively. Under drier meteorological conditions, air‐water CO2 fluxes also diminished in permanent floodplains and ponds, which even behaved as mild sinks for atmospheric CO2 during certain periods. Increased inputs of dissolved CO2 from the underground aquifer and the stream following periods of high rainfall are believed to be behind this pattern. Large lagoons with a managed water supply from an adjacent estuary took up atmospheric CO2 nearly permanently. Regional air‐water carbon transport was 15.2 GgC yr−1 under wet and 1.24 GgC yr−1 under dry meteorological conditions, well below the estimated net primary production for Doñana wetlands, indicating that the ecosystem acts as a large CO2 sink.