Evolutionary theory of aging predicts that women with increased reproductive effort live shorter lives, but evidence is inconsistent. These inconsistencies could be because environmental conditions influence how much reproductive behavior shapes a mother's lifespan, i.e. their lifespan cost of reproduction. Using a structural equation measurement model, we compare how reproductive effort affects lifespan of 4,684 women exposed across different life-stages, or not at all, to the Great Finnish Famine. We find that lifespan costs of reproduction became higher in mothers exposed to the famine during reproduction, and for these mothers amounted to a decreased life expectancy of ~0.5 years per child. Conversely, reproductive behavior did not shape the lifespans of mothers not exposed to the famine, or exposed post-reproduction or during development. These results suggest environment-dependent reproductive costs, which provides a biological explanation for previous inconsistent findings, and demonstrate how reproductive behavior can be an important determinant of human lifespan.