The microenvironment and community composition of microbial mats developing on beaches in Scapa Flow (Orkney Islands) were investigated. Analysis of characteristic biomarkers (major fatty acids, hydrocarbons, alcohols, and alkenones) revealed the presence of different groups of bacteria and microalgae in mats from Waulkmill and Swanbister beach, including diatoms, Haptophyceae, cyanobacteria, and sulfate-reducing bacteria. These analyses also indicated the presence of methanogens, especially in Swanbister beach mats, and therefore a possible role of methanogenesis for the carbon cycle of these sediments. High amounts of algal lipids and slightly higher numbers (genera, abundances) of cyanobacteria were found in Waulkmill Bay mats. However, overall only a few genera and low numbers of unicellular and filamentous cyanobacteria were present in mats from Waulkmill and Swanbister beach, as deduced from CLSM (confocal laser scanning microscopy) analysis. Spectral scalar irradiance measurements with fiber-optic microprobes indicated a pronounced heterogeneity concerning zonation and density of mainly anoxygenic phototrophs in Swanbister Bay mats. By microsensor and T-RFLP (terminal restriction fragment length polymorphism) analysis in Swanbister beach mats, the depth distribution of different populations of purple and sulfate-reducing bacteria could be related to the microenvironmental conditions. Oxygen, but also sulfide and other (inorganic and organic) sulfur compounds, seems to play an important role in the stratification and diversity of these two major bacterial groups involved in sulfur cycling in Swanbister beach mats.