Research in medicine and evolutionary biology suggests that the sequencing of parental investment has a crucial impact on offspring life history and health. Here, we take advantage of the synchronous birth system of wild banded mongooses to test experimentally the lifetime consequences to offspring of receiving extra investment prenatally versus postnatally. We provided extra food to half of the breeding females in each group during pregnancy, leaving the other half as matched controls. This manipulation resulted in two categories of experimental offspring in synchronously born litters: (i) ‘prenatal boost’ offspring whose mothers had been fed during pregnancy, and (ii) ‘postnatal boost’ offspring whose mothers were not fed during pregnancy but who received extra alloparental care in the postnatal period. Prenatal boost offspring lived substantially longer as adults, but postnatal boost offspring had higher lifetime reproductive success (LRS) and higher glucocorticoid levels across the lifespan. Both types of experimental offspring had higher LRS than offspring from unmanipulated litters. We found no difference between the two experimental categories of offspring in adult weight, age at first reproduction, oxidative stress or telomere lengths. These findings are rare experimental evidence that prenatal and postnatal investments have distinct effects in moulding individual life history and fitness in wild mammals.This article is part of the theme issue ‘Evolutionary ecology of inequality’.