The impact of nutritional status during fetal life on the overall health of adults has been recognized; however, dietary effects on the developing immune system are largely unknown. Development of secondary lymphoid organs occurs during embryogenesis and is considered to be developmentally programmed. Secondary lymphoid organ formation depends on a subset of type 3 innate lymphoid cells (ILC3) named lymphoid tissue inducer (LTi) cells. Here we show that mouse fetal ILC3s are controlled by cell-autonomous retinoic acid (RA) signalling in utero, which pre-sets the immune fitness in adulthood. We found that embryonic lymphoid organs contain ILC progenitors that differentiate locally into mature LTi cells. Local LTi cell differentiation was controlled by maternal retinoid intake and fetal RA signalling acting in a haematopoietic cell-autonomous manner. RA controlled LTi cell maturation upstream of the transcription factor RORγt. Accordingly, enforced expression of Rorgt restored maturation of LTi cells with impaired RA signalling, whereas RA receptors directly regulated the Rorgt locus. Finally, we established that maternal levels of dietary retinoids control the size of secondary lymphoid organs and the efficiency of immune responses in the adult offspring. Our results reveal a molecular link between maternal nutrients and the formation of immune structures required for resistance to infection in the offspring.