The relative importance of separation by distance and by environment to population genetic diversity can be conveniently tested in river networks, where these two drivers are often independently distributed over space. To evaluate the importance of dispersal and environmental conditions in shaping microbial population structures, we performed genome-resolved metagenomic analyses of benthic Microcoleus-dominated cyanobacterial mats collected in the Eel and Russian River networks (California, USA). The 64 Microcoleus genomes were clustered into three species that shared >96.5% average nucleotide identity (ANI). Most mats were dominated by one strain, but minor alleles within mats were often shared, even over large spatial distances (>300 km). Within the most common Microcoleus species, the ANI between the dominant strains within mats decreased with increasing spatial separation. However, over shorter spatial distances (tens of kilometres), mats from different subwatersheds had lower ANI than mats from the same subwatershed, suggesting that at shorter spatial distances environmental differences between subwatersheds in factors like canopy cover, conductivity, and mean annual temperature decreases ANI. Since mats in smaller creeks had similar levels of nucleotide diversity (π) as mats in larger downstream subwatersheds, within-mat genetic diversity does not appear to depend on the downstream accumulation of upstream-derived strains. The four-gamete test and sequence length bias suggest recombination occurs between almost all strains within each species, even between populations separated by large distances or living in different habitats. Overall, our results show that, despite some isolation by distance and environmental conditions, sufficient gene-flow occurs among cyanobacterial strains to prevent either driver from producing distinctive population structures across the watershed.