Mast seeding is one of the most intriguing reproductive traits in nature. Despite its potential drawbacks in terms of fitness, the widespread existence of this phenomenon suggests that it should have evolutionary advantages under certain circumstances. Using a global dataset of seed production time series for 219 plant species from all of the continents, we tested whether masting behaviour appears predominantly in species with low foliar nitrogen and phosphorus concentrations when controlling for local climate and productivity. Here, we show that masting intensity is higher in species with low foliar N and P concentrations, and especially in those with imbalanced N/P ratios, and that the evolutionary history of masting behaviour has been linked to that of nutrient economy. Our results support the hypothesis that masting is stronger in species growing under limiting conditions and suggest that this reproductive behaviour might have evolved as an adaptation to nutrient limitations and imbalances.