The effects of salinity fluctuation on bacterial diversity, rates of gross photosynthesis (GP) and oxygen consumption in the light (OCL) and in the dark (OCD) were investigated in three submerged cyanobacterial mats from a transect on an intertidal flat. The transect ran 1 km inland from the low water mark along an increasingly extreme habitat with respect to salinity. The response of GP, OCL and OCD in each sample to various salinities (65 per thousand, 100 per thousand, 150 per thousand and 200 per thousand) were compared. The obtained sequences and the number of unique operational taxonomic units showed clear differences in the mats' bacterial composition. While cyanobacteria decreased from the lower to the upper tidal mat, other bacterial groups such as Chloroflexus and Cytophaga/Flavobacteria/Bacteriodetes showed an opposite pattern with the highest dominance in the middle and upper tidal mats respectively. Gross photosynthesis and OCL at the ambient salinities of the mats decreased from the lower to the upper tidal zone. All mats, regardless of their tidal location, exhibited a decrease in areal GP, OCL and OCD rates at salinities > 100 per thousand. The extent of inhibition of these processes at higher salinities suggests an increase in salt adaptation of the mats microorganisms with distance from the low water line. We conclude that the resilience of microbial mats towards different salinity regimes on intertidal flats is accompanied by adjustment of the diversity and function of their microbial communities.