We reconstructed the paleoenvironmental conditions of the Mazarrón Basin during MIS 7 and MIS 1 based on their alkane and fatty acid contents, their mineralogy and the fossil content of an amino-acid-dated sediment sequence. The n-alkane and fatty acid indices proved to be excellent paleoenvironmental proxies for studying the paleo-hydrogeological and paleoclimatological evolution of this marshland. Three geochemical units (GUs) were identified from the abundance of the C25n-alkane and the ACL, TARHC and Paq values, confirming the importance of phases with terrestrial plant input or aquatic macrophyte predominance. These GUs were used to define three paleoenvironmental episodes (PEs) during MIS 7. In PE7.1, the contribution of algal and aquatic macrophytes predominated in a temporarily flooded saline muddy plain. In PE7.2, the major contribution was from aquatic macrophytes (flooded marsh), although it was marked by episodes of emersion with greater terrestrial contribution. At the top of the MIS 7 record (PE7.3), there was a significant reduction in the water depth, with the main input deriving from terrestrial plants in a muddy alluvial plain. Six PEs were established during MIS 1 (Holocene), of which three predominately received organic matter derived from aquatic macrophytes, while the major contribution in the other three came from terrestrial plants. The two sets of PEs were linked to episodes of increased and decreased water level, respectively. This interpretation is consistent with the characteristics of the sediment facies, with PE1.1, 1.3 and 1.5 corresponding to a marsh with deeper water and a greater input of detrital materials, and PE1.2, 1.4 and 1.6 to a shallow environment with carbonates and gypsum deposits. Direct marine influence was limited, so the oscillations in the water level in the marsh were likely to be more related to climatic changes (drier/wetter phases) and recent tectonics than to large changes in sea level. Emersion led to degradation of the organic matter and enrichment in short-chain and branched saturated fatty acids.