Pregnancy brings about profound changes in the mammary gland to prepare for lactation, yet immunocyte changes that accompany this rapid remodeling are incompletely understood. We comprehensively analyzed mammary T cells, revealing a marked increase in CD4+ and CD8+ T effector cells, including an expansion of T cell receptor (TCR)alpha beta+CD8 alpha alpha+ cells, in pregnancy and lactation. T cells were localized in the mammary epithelium, resembling intraepithelial lymphocytes (IELs) typically found in mucosal tissues. Similarity to mucosal tissues was substantiated by demonstrating partial dependence on microbial cues, T cell migration from the intestine to the mammary gland in late pregnancy and shared TCR clonotypes between intestinal and mammary tissues, including intriguing public TCR families. Putative counterparts of mammary IELs were found in human breast and milk. Mammary IELs are thus poised to manage the transition from a nonmucosal tissue to a mucosal barrier during lactogenesis.