Primary productivity is a key determinant of biodiversity patterns in plants and animals but has not previously been shown to affect bacterial diversity. We examined the relationship between productivity and bacterial richness in aquatic mesocosms designed to mimic small ponds. We observed that productivity could influence the composition and richness of bacterial communities. We showed that, even within the same system, different bacterial taxonomic groups could exhibit different responses to changes in productivity. The richness of members of the Cytophaga-Flavobacteria-Bacteroides group exhibited a significant hump-shaped relationship with productivity, as is often observed for plant and animal richness in aquatic systems. In contrast, we observed a significant U-shaped relationship between richness and productivity for α-proteobacteria and no discernable relationship for β-proteobacteria. We show, for the first time, that bacterial diversity varies along a gradient of primary productivity and thus make an important step towards understanding processes responsible for the maintenance of bacterial biodiversity.