ABSTRACTAssessing the relative importance of geographic and environmental factors to the spatial distribution of genetic variation may provide relevant information about the processes that maintain genetic variation in natural populations. With a globally wide but very restricted habitat distribution, mangrove trees are an interesting model for studies aiming to understand the contributions of these factors. Mangroves occur along the continent-ocean interface of tropical and subtropical latitudes, regions considered inhospitable to many other plant types. Here, we used landscape genomics approaches to investigate the relative contributions of geographic and environmental variables to the genetic variation of two black mangrove species, Avicennia schaueriana and Avicennia germinans, along the South American coast. Using single nucleotide polymorphisms, our results revealed an important role of ocean currents in the gene flow of A. schaueriana and isolation by environment as the pattern that best explains the genetic differentiation of A. germinans. Additionally, for both species, we observed significant correlations between genetic variation with evidence of selection and precipitation regimes, tidal variation, solar radiation and temperature patterns. These discoveries expand our knowledge about the evolution of mangrove trees and provide important information to predict future responses of coastal species to the expected global changes for this century.