Understanding the distribution of crop genetic diversity in relation to environmental factors can give insights into the eco-evolutionary processes involved in plant domestication. Yam beans (Pachyrhizus Rich. ex DC.) are leguminous crops native to South and Central America that are grown for their tuberous roots but are seed-propagated. Using a landscape genetic approach, we examined correlations between environmental factors and phylogeographic patterns of genetic diversity in Pachyrhizus landrace populations. Molecular analyses based on chloroplast DNA sequencing and a new set of nuclear microsatellite markers revealed two distinct lineages, with strong genetic differentiation between Andean landraces (lineage A) and Amazonian landraces (lineage B). The comparison of different evolutionary scenarios for the diversification history of yam beans in the Andes using approximate Bayesian computation suggests that Pachyrhizus ahipa and Pachyrhizus tuberosus share a progenitor-derivative relationship, with environmental factors playing an important role in driving selection for divergent ecotypes. The new molecular data call for a revision of the taxonomy of Pachyrhizus but are congruent with paleoclimatic and archeological evidence, and suggest that selection for determinate growth was part of ecophysiological adaptations associated with the diversification of the P. tuberosus–P. ahipa complex during the Mid-Holocene.