Early life environmental exposure, particularly during perinatal period, can have a life-long impact on organismal development and physiology. The biological rationale for this phenomenon is to promote physiological adaptations to the anticipated environment based on early life experience. However, perinatal exposure to adverse environments can also be associated with adult-onset disorders. Multiple environmental stressors induce glucocorticoids, which prompted us to investigate their role in developmental programming. Here, we report that perinatal glucocorticoid exposure had long-term consequences and resulted in diminished CD8 T cell response in adulthood and impaired control of tumor growth and bacterial infection. We found that perinatal glucocorticoid exposure resulted in persistent alteration of the hypothalamic-pituitary-adrenal (HPA) axis. Consequently, the level of the hormone in adults was significantly reduced, resulting in decreased CD8 T cell function. Our study thus demonstrates that perinatal stress can have long-term consequences on CD8 T cell immunity by altering HPA axis activity.