Earth scientists have searched for signs of microscopic life in ancient samples of permafrost, ice, deep-sea sediments, amber, salt and chert. Until now, evidence of cyanobacteria has not been reported in any studies of ancient DNA older than a few thousand years. Here, we investigate morphologically, biochemically and genetically primary evaporites deposited in situ during the late Miocene (Messinian) Salinity Crisis from the north-eastern Apennines of Italy. The evaporites contain fossilized bacterial structures having identical morphological forms as modern microbes. We successfully extracted and amplified genetic material belonging to ancient cyanobacteria from gypsum crystals dating back to 5.910–5.816 Ma, when the Mediterranean became a giant hypersaline brine pool. This finding represents the oldest ancient cyanobacterial DNA to date. Our clone library and its phylogenetic comparison with present cyanobacterial populations point to a marine origin for the depositional basin. This investigation opens the possibility of including fossil cyanobacterial DNA into the palaeo-reconstruction of various environments and could also be used to quantify the ecological importance of cyanobacteria through geological time. These genetic markers serve as biosignatures providing important clues about ancient life and begin a new discussion concerning the debate on the origin of late Miocene evaporites in the Mediterranean.