We investigate how variations in soil productivity affect civil conflicts. We first present a model with heterogeneous land in which variations in input prices (fertilizers) affect appropriable rents and the opportunity costs of fighting. The theory predicts that spikes in input prices increase the likelihood of conflicts through their effect on income and inequality, and that this effect is magnified when soil fertility is naturally more heterogeneous. We test these predictions using data on conflict events covering all Sub-Saharan African countries at a spatial resolution of 0.5 × 0.5 degree latitude and longitude over the 1997–2013 period. We combine information on soil characteristics and worldwide variations in fertilizer prices to identify local exogenous changes in input costs. As predicted, variations in soil productivity triggered by variations in fertilizer prices are positively associated with conflicts, especially in cells where land endowments are more heterogeneous. In addition, we find that the distribution of land fertility both within and across ethnic groups affects violence, and that the effect of between-group heterogeneity in soil quality is magnified in densely populated areas. Overall, our findings imply that inequality in access to fertile areas—an issue largely neglected in the literature dealing with the roots of Sub-Saharan African civil wars—constitutes a serious threat to peace at the local level.