The structure of the microbial community and the diversity of the functional gene for dinitrogenase reductase and its transcripts were investigated by analyzing >1400 16S rRNA gene and nifH sequences from two microbial mats situated in the intertidal zone of the Dutch barrier island Schiermonnikoog. Although both microbial mat communities were dominated by Cyanobacteria, they differed with respect to the composition of the total bacterial community. Proteobacteria-related sequences were retrieved as the second most abundant group higher up in the littoral (Station I), whereas Bacteroidetes were the second most abundant group at the low water mark (Station II). The diazotrophic (nitrogen-fixing) communities at both stations were also different, but had more operational taxonomic units in common than the total bacterial community. Denaturing gradient gel electrophoresis also revealed differences in the total bacterial and diazotrophic community in two consecutive years. Analysis of the expression of nifH at Station I showed a discrepancy between the present and the active diazotrophic community. Transcript abundances of the different diazotrophs changed over a 24-h cycle and were dominated by cyanobacterial lineages in the daytime, while Gammaproteobacteria peaked at night. These variations might be responsible for the pattern in nitrogenase activity observed in these mats.