It has been suggested that a heterogeneous environment enhances species richness and allows for the coexistence of species. However, there is increasing evidence that environmental heterogeneity can have no effect or even a negative effect on plant species richness and plant coexistence at a local scale. We examined whether plant species richness increases with local heterogeneity in the water table depth, microtopography, pH and light availability in a swamp forest community at three local spatial scales (grain: 0.6, 1.2 and 11.4 m). We also used the variance partitioning approach to assess the relative contributions of niche-based and other spatial processes to species occurrence. We found that heterogeneity in microtopography and light availability positively correlated with species richness, in accordance with the habitat heterogeneity hypothesis. However, we recorded different heterogeneity-diversity relationships for particular functional species groups. An increase in the richness of bryophytes and woody plant species was generally related to habitat heterogeneity at all measured spatial scales, whereas a low impact on herbaceous species richness was recorded only at the 11.4 m scale. The distribution of herbaceous plants was primarily explained by other spatial processes, such as dispersal, in contrast to the occurrence of bryophytes, which was better explained by environmental factors. Our results suggest that both niche-based and other spatial processes are important determinants of the plant composition and species turnover at local spatial scales in swamp forests.