The impacts of diet deprivation and subsequent overallowance during gestation on mammary gene expression and development and lactation performance were determined. Gilts were reared under a conventional (control, CTL; n = 59) or an experimental (treatment, TRT; n = 56) dietary regimen during gestation. The experimental regimen provided 70% (restriction diet, RES) and 115% (overallowance diet, OVER) of the protein and DE contents provided by the CTL diet. The RES diet was given during the first 10 wk of gestation followed by the OVER diet until farrowing. Some gilts (14 CTL and 14 TRT) were slaughtered on d 110 of gestation, and the others were allowed to farrow. Of these remaining sows, 28 (14 CTL and 14 TRT) were slaughtered on d 21 of lactation, and the rest underwent a second lactation. At each slaughter, mammary tissue was collected for compositional analyses and assessment of gene expression. Milk samples were collected on d 17 of the first lactation. Litter size was standardized to 11 ± 1, and piglets were weighed weekly until d 18 in both parities. The BW and back fat thickness of TRT first-parity sows were less than those of CTL sows in gestation (P< 0.05), and their BW was also less in lactation (P < 0.05). The BW of TRT second-parity sows was still less at mating (P < 0.05) and tended to be less on d 1 of lactation (P < 0.10) compared with CTL sows. There were no differences in piglet growth between CTL and TRT litters in either parity, yet mammary development and mammary gene expression were affected by treatment. There was less parenchymal tissue (P < 0.01) at the end of the first gestation in TRT than in CTL sows, but parenchymal tissue composition was not altered by treatment. Relative abundance of IGF-1 (P < 0.05), ornithine decarboxylase (P < 0.05), signal transducer and activator of transcription 5B (P < 0.05), and whey acidic protein (WAP, P < 0.01) genes in parenchyma at the end of the first gestation was lower in TRT than in CTL sows, and the effect on WAP genes was still present at the end of the first lactation (P < 0.01). Mammary composition at the end of the first lactation and milk composition were unaffected by treatment. In conclusion, feed deprivation and subsequent overallowance in gestation had unfavorable effects on sow BW, back fat, mammary development, and mammary gene expression at the end of gestation, but piglet growth rate over the 2 parities was not affected.