Modern Ca:Mg carbonate stromatolites form in association with the microbial mat in the hypersaline coastal lagoon, Lagoa Vermelha (Brazil). The stromatolites, although showing diversified fabrics characterized by thin or crude lamination and/or thrombolitic clotting, exhibit a pervasive peloidal microfabric. The peloidal texture consists of dark, micritic aggregates of very high-Mg calcite and/or Ca dolomite formed by an iso-oriented assemblage of sub-micron trigonal polyhedrons and organic matter. Limpid acicular crystals of aragonite arranged in spherulites surround these aggregates. Unlike the aragonite crystals, organic matter is present consistently in the dark, micritic carbonate comprising the peloids. This organic matter is observed as sub-micron flat and filamentous mucus-like structures inside the interspaces of the high-Mg calcite and Ca dolomite crystals and is interpreted as the remains of degraded extracellular polymeric substances. Moreover, many fossilized bacterial cells are associated strictly with both carbonate phases. These cells consist mainly of 0·2 to 4 μm in diameter, sub-spherical, rod-like and filamentous forms, isolated or in colony-like clusters. The co-existence of fossil extracellular polymeric substances and bacterial bodies, associated with the polyhedrons of Ca:Mg carbonate, implies that the organic matter and microbial metabolism played a fundamental role in the precipitation of the minerals that form the peloids. By contrast, the lack of extracellular polymeric substances in the aragonitic phase indicates an additional precipitation mechanism. The complex processes that induce mineral precipitation in the modern Lagoa Vermelha microbial mat appear to be recorded in the studied lithified stromatolites. Sub-micron polyhedral crystal formation of high-Mg calcite and/or Ca dolomite results from the coalescence of carbonate nanoglobules around degraded organic matter nuclei. Sub-micron polyhedral crystals aggregate to form larger ovoidal crystals that constitute peloids. Subsequent precipitation of aragonitic spherulites around peloids occurs as micro-environmental water conditions around the peloids change.