Population and species divergence in South America are usually attributed to geographical barriers in the form of rivers, mountains or climate. In western Amazonia (< 1000 m elevation) case studies addressing the ecological niche as a divergent selection agent are scarce. Using sequences from five plastid and six low-copy nuclear DNA regions, we reconstructed coalescent species phylogenetic trees for Astrocaryum section Huicungo (15 species, Arecaceae), which corroborated the presence of two lineages distributed north and south of 5°S in western Amazonia. Using elevation, three climatic and six soil variables we evaluated the ecological niche of each lineage. Different annual precipitation regimes were associated with each lineage. Notably, a lower precipitation seasonality and lower elevation were attributed for the northern clade and the opposite was found for the southern clade. We also explored the diagnostic and evolutionary importance of 35 anatomical and 31 morphological characters using a phylogenetic analysis and ancestral character reconstructions. None of the anatomical characters was diagnostic for either lineage. However, hypodermal cell wall width and the location of aerenchyma had different ancestral states for the two lineages, and their adaptive values to the dry season differences are discussed.