Many studies analyzing the relative contribution of soil properties versus distance-related processes on plant species composition have focused on lowland tropical forests. Very few have investigated two forest types simultaneously, to contrast ecological processes that assemble the communities. This study analyses—at the landscape scale—the relative contribution of soil and distance on lowland and submontane tropical forests, which co-occur in two reserves of the Azuero peninsula (Panama). Floristic inventories and soil sampling were conducted in 81 0.1-ha plots clustered in 27 sites, and data were analyzed using Mantel tests, variance partitioning and non-metric multidimensional scaling. The largest differences in floristic composition occurred between reserves in both forest types. Soil variation and geographic distance were important determinants of floristic composition, but their effects were highly correlated; together they explained 7–25 percent and 46–50 percent of the variation in lowland and submontane forests, respectively. Soil variables that had the best correlations with floristic composition were iron, zinc, and silt content in lowland, and calcium, copper, iron, potassium, magnesium, phosphorus, zinc, and sand content in submontane forests. The studied forests showed a high beta diversity that seems to be related primarily with soils and, secondarily, with dispersal limitation and stochastic events. The results reveal a response of tree assemblages to environmental gradients, which are particularly conspicuous in Panama. The effects of limited dispersal seem to be more important in submontane than in lowland forests, probably as a result of higher isolation.