Elytrigia atherica is a native invasive plant species whose expansion on salt marshes is attributed to genotypic and phenotypic adaptations to non-ideal environmental conditions, forming two ecotypes. It is unknown how E. atherica–microbiome interactions are contributing to its adaptation. Here we investigated the effect of sea-water flooding frequency and associated soil (a)biotic conditions on plant traits and root-associated microbial community composition and potential functions of two E. atherica ecotypes. We observed higher endomycorrhizal colonization in high-elevation ecotypes (HE, low inundation frequency), whereas low-elevation ecotypes (LE, high inundation frequency) had higher specific leaf area. Similarly, rhizosphere and endosphere bacterial communities grouped according to ecotypes. Soil ammonium content and elevation explained rhizosphere bacterial composition. Around 60% the endosphere amplicon sequence variants (ASVs) were also found in soil and around 30% of the ASVs were ecotype-specific. The endosphere of HE-ecotype harbored more unique sequences than the LE-ecotype, the latter being abundant in halophylic bacterial species. The composition of the endosphere may explain salinity and drought tolerance in relation to the local environmental needs of each ecotype. Overall, these results suggest that E. atherica is flexible in its association with soil bacteria and ecotype-specific dissimilar, which may enhance its competitive strength in salt marshes.