Many prior studies have uncovered evidence for local adaptation using reciprocal transplant experiments. However, these studies are rarely conducted for a long enough time to observe succession and competitive dynamics in a community context, limiting inferences for long‐lived species. Furthermore, the genetic basis of local adaptation and genetic associations with climate has rarely been identified. Here, we report on a long‐term (6‐year) experiment conducted under natural conditions focused on Andropogon gerardii, the dominant grass of the North American Great Plains tallgrass ecosystem. We focus on this foundation grass that comprises 80% of tallgrass prairie biomass and is widely used in 20,000 km2 of restoration. Specifically, we asked the following questions: (a) Whether ecotypes are locally adapted to regional climate in realistic ecological communities. (b) Does adaptive genetic variation underpin divergent phenotypes across the climate gradient? (c) Is there evidence of local adaptation if the plants are exposed to competition among ecotypes in mixed ecotype plots? Finally, (d) are local adaptation and genetic divergence related to climate? Reciprocal gardens were planted with 3 regional ecotypes (originating from dry, mesic, wet climate sources) of Andropogon gerardii across a precipitation gradient (500–1,200 mm/year) in the US Great Plains. We demonstrate local adaptation and differentiation of ecotypes in wet and dry environments. Surprisingly, the apparent generalist mesic ecotype performed comparably under all rainfall conditions. Ecotype performance was underpinned by differences in neutral diversity and candidate genes corroborating strong differences among ecotypes. Ecotype differentiation was related to climate, primarily rainfall. Without long‐term studies, wrong conclusions would have been reached based on the first two years. Further, restoring prairies with climate‐matched ecotypes is critical to future ecology, conservation, and sustainability under climate change.