We examined the distribution of tree species across five habitats in 69 small plots within a single watershed of the Gunung Palung National Park, West Kalimantan, Indonesia (GPNP). The spatially complex distribution and close proximity of habitats provided an opportunity to test habitat specificity of tree species across strong environmental gradients, in a situation where dispersal into ‘inappropriate’ habitat should not be a rare event. Habitat had a weak influence on community structure, although species diversity was lower in the alluvium and peat habitats. Association tests based on two randomization models (spatially independent and explicit) were used to examine habitat distribution of 55 ‘common’ and 142 ‘frequent’ taxa. The general patterns were similar in the two models but the interpretation of specific patterns depended greatly on assumptions about dispersal ability. A majority (67%) of the common species was significantly associated with a single habitat, while few were restricted to one habitat. A small proportion (16%) of the species appear to be habitat generalists. The peat habitat had the most profound effect on species distribution. Overall, a large amount of variation was found in the degree of habitat specificity, even within speciose groups. No obvious evolutionary or ecological correlates with degree of habitat specificity were found. These results suggest that a mixture of stochastic and deterministic processes determine species distribution even across strong environmental gradients.