Time-of-flight secondary ion mass spectrometry (ToF-SIMS) is a surface sensitive MS technique that offers a new way of studying lipid biomarkers at the microscopic level, without the need to destroy the physical integrity of the sample by extraction. We applied ToF-SIMS to a cryosection of a microbial mat and compared the results with ToF-SIMS and gas chromatography-MS (GC-MS) analysis of extracts from the same material. A wide range of lipid biomarkers was identified with ToF-SIMS in the microbial mat cryosection. Spectra and ion images revealed that individual biomarkers, including fatty acids, mono-, di- and triacylglycerols, carotenoids and chlorophyll were localized with diatom cells identified as Planothidium lanceolatum using optical microscopy. This diatom species can thus be regarded as a major lipid source within the microbial mat system. The results underpin the idea that ToF-SIMS has the potential to become an important technique for future biomarker studies, in particular for the clear cut assignment of biomarkers to distinctive morphological structures and specific microorganisms within complex biogeochemical samples.