Summary1. Theory suggests spatial heterogeneity can facilitate species co-occurrence at fine scales, but environmental data are rarely collected at sufficiently high resolution to test this empirically. Whilst there is emerging evidence that subtle variation in soil hydrology represents a fundamental fine-scale niche axis within plant communities, this is largely derived from studies of soil hydrology in isolation from other environmental factors. 2. We assessed the comparative importance of fine-scale hydrological niche differentiation for species co-occurrence using a high-resolution study of soil hydrology and other edaphic variables, coupled with a long-term (24 years) data set of herbaceous plant plots in a heathland community in south-east Australia.3. For the analysis, we employed novel latent variable models (LVMs), which offer an explicit, model-based approach to partitioning out the different drivers of species co-occurrence patterns. Whilst the regression component of an LVM models the species-specific environmental responses, the latent variable component can be used to identify residual patterns of co-occurrence, which may be attributable to unmeasured factors and/or biotic interactions. 4. Relative to a host of plant resources, non-resource factors and 'unmeasured' latent variables, soil hydrology emerged as the best predictor of negative co-occurrences within the community, with the dominant species exhibiting strongly differentiated responses across a comparatively narrow moisture gradient. Nevertheless, strong species-specific responses to environmental variability only emerged at scales greater than those at which plants may be expected to compete for resources, throwing doubt on the direct role of spatial heterogeneity as a mechanism for local-scale coexistence. 5. Synthesis. This study confirms the vital role of hydrological niches for the maintenance of within-community plant diversity, but also highlights the need for more rigorous analysis of scale dependencies to better understand the underlying coexistence mechanisms at play. In addition, it illustrates the inferential gains made possible with model-based approaches to the analysis of species co-occurrence. R code illustrating model fitting and inference is provided as a supplement.