Prenatal events can affect neonatal thymus size and adult immune function. The causal insults are unknown, although fetal nutrient restriction is suspected. We used ultrasound at three time points during pregnancy (14, 19 and 30 weeks) to measure the growth of six fetal dimensions in rural Bangladeshi women participating in the Maternal and Infant Nutrition Interventions, Matlab study. Postnatal ultrasound was used to calculate thymic index (TI) at birth, 2, 6 and 12 m. Of the 3267 women recruited, 2861 participated by providing data at least at one fetal biometry and one TI time point. Patterns of fetal growth were summarized using principal components calculated from fetal dimension z-scores. Random effects regression, controlling for infant size and season of measurement were used to relate these patterns to TI. We found that smaller leg length relative to head circumference, characteristic of head-sparing growth restriction, was predictive of lower TI. This association was significant at all time points but strongest in earlier pregnancy. Each standard deviation increase in leg–head proportion was associated with an increase in TI of ∼5%. We conclude that growth patterns typical of poor fetal nutrition are associated with poor thymic development. The greater strength of this association in the first trimester is consistent with a period of vulnerability during the early ontogeny of the thymus and suggests that preventative intervention would need to be given in early pregnancy.