Aims Increases in anthropogenic nitrogen (N) deposition are expected to lead to an overall higher mean and lower variance of N in the soil, which may disproportionately affect leguminous plants that acquire N both symbiotically via rhizobia and abiotically from soil. Here, we investigate the effects of changing N-heterogeneity at a fine spatial scale on the legume-rhizobium symbiosis. Methods We used a split-root system to introduce local soil N-heterogeneity, while maintaining the same overall plant-level amount of N. We treated root halves of five inbred lines ofMedicago truncatula(HapMap lines 267, 270, 276, 279, and 313) with 50%-50%, 20%-80%, 10%-90%, or 2%-98% N and inoculated them with twoEnsifer melilotistrains that differ in N-fixation ability. Results Although shoot biomass was unaffected by N-heterogeneity, plant lines adjusted their relative investments in nodulation versus root proliferation to optimize N-acquisition; high-N root halves tended to invest more into root proliferation, while low-N root halves invested more into nodule formation. We detected hidden plasticity in partner choice: although all plants formed more nodules with the more effective N-fixing strain, roots experiencing greater N-limitation increased preference for effective N-fixing rhizobia. Furthermore, there was significant variation among plant lines in root proliferation and nodulation responses to N-heterogeneity. Conclusion In response to N-heterogeneity,M. truncatulaexhibited phenotypic plasticity in root proliferation, nodulation, and partner choice at the local half-root level. We suggest that plasticity in response to rhizosphere conditions makes legumes potentially resilient to changes in N-heterogeneity, particularly in a time of anthropogenic N deposition.