All cyanobacterial mats that have been investigated have been proven to be diazotrophic, i.e., use atmospheric dinitrogen (N2) as the source of nitrogen. Many cyanobacteria possess the capacity to fix N2 and different species have evolved various ways to cope with the sensitivity of nitrogenase toward oxygen which is produced by these oxygenic phototrophs. These different strategies give rise to complex patterns of nitrogenase activity in microbial mats. Nitrogenase activity may exhibit complex variations over a day–night cycle but different types of microbial mats may also have their own characteristic patterns. Besides the cyanobacteria, numerous other members of the Bacteria as well as some Archaea are known to be diazotrophic. The complexity of the microbial community and of the observed patterns of nitrogenase activity makes it difficult to understand how the different groups of organisms contribute to N2 fixation in microbial mats. Cyanobacteria have ample access to energy (sunlight) and reducing equivalents (water) and therefore easily satisfy the demands of nitrogenase. As well, since they also fix CO2, they are able to synthesize the acceptor molecules for the fixed nitrogen. However, it is also feasible that other diazotrophs in a joint venture with cyanobacteria are responsible for the bulk of the fixed nitrogen. In this review we discuss the importance of cyanobacteria as diazotrophs in microbial mats, their interactions with other potential N2-fixing microorganisms, and the factors that control their activities.