Prenatal exposure to high-energy diets (HED) increases the susceptibility for behavioral alterations in the male offspring. We addressed whether prenatal HED primes the transgenerational inheritance of structural brain changes impacting anxiety/depression-like behavior in the offspring. For this, we used female Wistar rats exposed to a HED (cafeteria diet, CAF, n = 6) or chow (control, CON, n= 6) during development. Anxiety and depression-like behavior was evaluated in the filial 1 (F1), filial 2 (F2) and filial 3 (F3) male offspring using the open field (OFT), elevated plus maze (EM), novelty suppressed feeding (NSFT), tail suspension (TST) and forced swimming (FST) tests. Structural brain changes were identified by deformation-based morphometry (DBM) and diffusion tensor imaging (DTI) usingex vivomagnetic resonance imaging (MRI). We found that the F1, F2 and F3 offspring exposed to CAF diet displayed higher anxious scores including longer feeding latency during the NSFT, and in the closed arms and only F1 offspring showed longer stay on edges during the OFT versus control offspring. DBM analysis revealed that CAF offspring exhibited altered volume in cerebellum, hypothalamus, amygdala and hippocampus preserved up to the F3 generation of anxious individuals. Also, F3 CAF anxious exhibited greater fractional anisotropy and axial diffusivity in the amygdala, greater apparent diffusion coefficient in the corpus callosum and greater axial diffusivity in the hippocampus respect to the control. Our results suggest that prenatal and lactation exposure to HED programs the transgenerationally inheritance of structural brain changes related to an anxiety-like behavior in the male offspring.Significance statementPrenatal and lactation programming by HED exposure primes the transgenerational inheritance of aberrant behaviors in the offspring. A deeper understanding of the effect of diet on structural brain alterations that code for anxiety-like behavior and their transgenerational inheritance may allow the identification of new targets for future interventions. We used magnetic resonance imaging to globally and selectively characterize diet-dependent structural brain changes and anxiety-like behavior in the F1, F2 and F3 generations of rats. The current findings suggest that prenatal and lactation exposure to HED affects brain structure leading to anxiety-like behavior which is transgenerational preserved on the F2 and F3 generations.