Both spatial heterogeneity and exploiters (parasites and predators) have been implicated as key ecological factors driving population diversification. However, it is unclear how these factors interact. We addressed this question using the common plant‐colonizing bacterium Pseudomonas fluorescens, which has been shown to diversify rapidly into spatial niche‐specialist genotypes when propagated in laboratory microcosms. Replicate populations were evolved in spatially homogeneous and heterogeneous environments (shaken and static microcosms, respectively) with and without viral parasites (bacteriophage) for approximately 60 bacterial generations. Consistent with previous findings, exploiters reduced diversity in heterogeneous environments by relaxing the intensity of resource competition. By contrast, exploiters increased diversity in homogeneous environments where there was little diversification through resource competition. Competition experiments revealed this increase in diversity to be the result of fitness trade‐offs between exploiter resistance and competitive ability. In both environments, exploiters increased allopatric diversity, presumably as a result of divergent selection for resistance between populations. Phage increased total diversity in homogeneous environments, but had no net effect in heterogeneous environments. Such interactions between key ecological variables need to be considered when addressing diversification and coexistence in future studies.