XIAP is an endogenous inhibitor of cell death and inactivating mutations of XIAP are responsible for X-linked lymphoproliferative disease (XLP-2) and primary immunodeficiency, but the mechanism(s) behind these contradictory outcomes have been unclear. We report that during infection of macrophages and dendritic cells with various intracellular bacteria, XIAP restricts cell death and secretion of IL-1β but promotes increased activation of NFκB and JNK which results in elevated secretion of IL-6 and IL-10. Poor secretion of IL-6 byXiap-deficient antigen presenting cells leads to poor expansion of recently activated CD8 T cells during the priming phase of the response. On the other hand,Xiap-deficient CD8 T cells displayed increased proliferation and effector function during the priming phase but underwent enhanced contraction subsequently.Xiap-deficient CD8 T cells underwent skewed differentiation towards short lived effectors which resulted in poor generation of memory. ConsequentlyXiap-deficient CD8 T cells failed to provide effective control of bacterial infection during re-challenge. These results reveal the temporal impact of XIAP in promoting the fitness of activated CD8 T cells through cell extrinsic and intrinsic mechanisms and provide a mechanistic explanation of the phenotype observed in XLP-2 patients.