Primary gypsum deposits, which accumulated in the Mediterranean Basin during the so-called Messinian salinity crisis (5.97-5.33Ma), represent an excellent archive of microbial life. We investigated the molecular fossil inventory and the corresponding compound-specific δ13 C values of bottom-grown gypsum formed during the first stage of the crisis in four marginal basins across the Mediterranean (Nijar, Spain; Vena del Gesso, Italy; Heraklion, Crete; and Psematismenos, Cyprus). All studied gypsum samples contain intricate networks of filamentous microfossils, whose phylogenetic affiliation has been debated for a long time. Petrographic analysis, molecular fossil inventories (hydrocarbons, alcohols, and carboxylic acids), and carbon stable isotope patterns suggest that the mazes of filamentous fossils represent benthic microbial assemblages dominated by chemotrophic sulfide-oxidizing bacteria; in some of the samples, the body fossils are accompanied by lipids produced by sulfate-reducing bacteria. Abundant isoprenoid alcohols including diphytanyl glycerol diethers (DGDs) and glycerol dibiphytanyl glycerol tetraethers (GDGTs), typified by highly variable carbon stable isotope composition with δ13 C values spanning from -40 to -14‰, reveal the presence of planktic and benthic archaeal communities dwelling in Messinian paleoenvironments. The compound inventory of archaeal lipids indicates the existence of a stratified water column, with a normal marine to diluted upper water column and more saline deeper waters. This study documents the lipid biomarker inventory of microbial life preserved in ancient gypsum deposits, helping to reconstruct the widely debated conditions under which Messinian gypsum formed.