The Lake Afourgagh sediment record and facies successions provide an outstanding example of environmentally controlled carbonate sedimentation. Afourgagh is a small, shallow permanent lake located in the Middle-Atlas Mountains in Morocco in a karstic context. It is fed by ground waters that are relatively enriched in Mg resulting from the leaching of the Jurassic dolomitic bedrock of the catchment. This eutrophic lake is episodically restricted and characterized by alkaline waters with a fluctuating high Mg/Ca ratio. The maximum extension of the Holocene shoreline coincides with evidence of a lake stabilization level corresponding to the outflow of the lake through a wadi. Lakeshore terrace sediments deposited on an alluvial fan siltstone during the past ca 2500 cal yr bp comprise four main facies: a littoral crust, palaeosols, palustrine silts and charophyte tufas, which reflect different environments from the shoreline toward the deeper water. In the more distal parts, the charophyte tufas display a well-expressed lamination punctuated by the development of microstromatolites on algae thalli. The mineralogical composition of the carbonates is linked to the facies. While the charophyte tufas are characterized by a relatively high content in aragonite, in addition to low-Mg calcite, the littoral crust is mainly composed of magnesite. This pattern is related to the evolving chemistry of water due to the influence of charophyte proliferation during dry summers. Calcium-carbonate precipitation on algae thalli (both bioinduced and microbially mediated) progressively induces an increase in the Mg/Ca ratio of the lake water, while the capillary evaporation of shallow ground waters causes precipitation of a magnesite precursor on the shoreline, producing magnesite during early diagenesis. This effect is characteristic of two episodes: part of the Roman Warm Period and the beginning of the Dark Age Cold Period. The carbonate mineralogy of the different depositional sequences at Afourgagh indicates lake-level and water-chemistry fluctuations under a climatic influence. Therefore, among other regional records, the Lake Afourgagh sedimentary record provides useful evidence for reconstructing these environmental changes.